Skip to content

Commit f62afac

Browse files
authored
Change file name pattern for snap files (argotorg#852)
1 parent 01aa598 commit f62afac

30 files changed

Lines changed: 30 additions & 1 deletion

File tree

crates/test-utils/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ macro_rules! assert_harness_gas_report {
1717

1818
($harness: expr, $($expr:expr),*) => {
1919
let mut settings = insta::Settings::clone_current();
20-
settings.set_snapshot_suffix(format!("{:?}", $($expr,)*));
20+
let suffix = format!("{:?}", $($expr,)*).replace("\"", "");
21+
settings.set_snapshot_suffix(suffix);
2122
let _guard = settings.bind_to_scope();
2223
assert_snapshot!(format!("{}", $harness.gas_reporter));
2324
}

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"add".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@add.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
add([Uint(2), Uint(5)]) used 268 gas

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"add_from_mem".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@add_from_mem.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
add_from_mem([Uint(2), Uint(5)]) used 806 gas

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"add_from_sto".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@add_from_sto.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
add_from_sto([Uint(2), Uint(5)]) used 22616 gas

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"bit_and".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@bit_and.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
bit_and([Uint(26), Uint(42)]) used 510 gas

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"bit_or".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@bit_or.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
bit_or([Uint(26), Uint(42)]) used 475 gas

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"bit_xor".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@bit_xor.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
bit_xor([Uint(26), Uint(42)]) used 494 gas

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"div".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@div.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
div([Uint(43), Uint(5)]) used 330 gas

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"lshift".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@lshift.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
lshift([Uint(1), Uint(7)]) used 431 gas

crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@"mod".snap renamed to crates/tests/src/snapshots/fe_compiler_tests__features__aug_assign@mod.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: crates/tests/src/features.rs
3+
assertion_line: 1779
34
expression: "format!(\"{}\", harness.gas_reporter)"
45
---
56
mod([Uint(43), Uint(5)]) used 352 gas

0 commit comments

Comments
 (0)