Skip to content

Commit 8f042dc

Browse files
committed
fix snapshot test harness
1 parent 1c1da35 commit 8f042dc

File tree

4 files changed

+90
-76
lines changed

4 files changed

+90
-76
lines changed

test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,27 +1167,27 @@ script {
11671167
!234 = span !184 71080 71101
11681168
!235 = fn_call_path_span !184 71080 71093
11691169
!236 = (!234 !235)
1170-
!237 = span !184 89587 89627
1170+
!237 = span !184 89781 89821
11711171
!238 = (!234 !235 !237)
1172-
!239 = span !184 89607 89627
1172+
!239 = span !184 89801 89821
11731173
!240 = (!234 !235 !237)
1174-
!241 = span !184 89653 89666
1174+
!241 = span !184 89847 89860
11751175
!242 = (!234 !235 !241)
1176-
!243 = span !184 89637 89667
1176+
!243 = span !184 89831 89861
11771177
!244 = (!234 !235 !243)
1178-
!245 = span !184 89752 89757
1178+
!245 = span !184 89946 89951
11791179
!246 = (!234 !235 !245)
1180-
!247 = span !184 89676 89759
1180+
!247 = span !184 89870 89953
11811181
!248 = (!234 !235 !247)
11821182
!249 = (!234 !235 !247)
1183-
!250 = span !184 89769 89783
1183+
!250 = span !184 89963 89977
11841184
!251 = (!234 !235 !250)
1185-
!252 = span !184 89781 89782
1185+
!252 = span !184 89975 89976
11861186
!253 = (!234 !235 !250)
1187-
!254 = span !184 89799 89800
1187+
!254 = span !184 89993 89994
11881188
!255 = (!234 !235 !254)
1189-
!256 = span !184 89799 89804
1190-
!257 = fn_call_path_span !184 89801 89802
1189+
!256 = span !184 89993 89998
1190+
!257 = fn_call_path_span !184 89995 89996
11911191
!258 = (!234 !235 !256 !257)
11921192
!259 = (!234 !235 !256 !257)
11931193
!260 = (!234 !235 !256 !257)
@@ -1198,17 +1198,17 @@ script {
11981198
!265 = (!234 !235 !256 !257 !264)
11991199
!266 = (!234 !235 !256 !257)
12001200
!267 = (!234 !235 !256 !257)
1201-
!268 = span !184 89848 89853
1201+
!268 = span !184 90042 90047
12021202
!269 = (!234 !235 !268)
1203-
!270 = span !184 89855 89856
1203+
!270 = span !184 90049 90050
12041204
!271 = (!234 !235 !270)
1205-
!272 = span !184 89819 89858
1205+
!272 = span !184 90013 90052
12061206
!273 = (!234 !235 !272)
12071207
!274 = (!234 !235 !272)
1208-
!275 = span !184 89879 89885
1208+
!275 = span !184 90073 90079
12091209
!276 = (!234 !235 !275)
1210-
!277 = span !184 89879 89899
1211-
!278 = fn_call_path_span !184 89886 89892
1210+
!277 = span !184 90073 90093
1211+
!278 = fn_call_path_span !184 90080 90086
12121212
!279 = (!234 !235 !277 !278)
12131213
!280 = span !184 3973 3977
12141214
!281 = (!234 !235 !277 !278 !280)
@@ -1333,17 +1333,17 @@ script {
13331333
!400 = (!234 !235 !277 !278 !282 !283 !287 !288 !371 !372)
13341334
!401 = (!234 !235 !277 !278 !282 !283 !287 !288)
13351335
!402 = (!234 !235 !277 !278 !282 !283 !287 !288)
1336-
!403 = span !184 89872 89876
1336+
!403 = span !184 90066 90070
13371337
!404 = (!234 !235 !403)
1338-
!405 = span !184 89871 89899
1338+
!405 = span !184 90065 90093
13391339
!406 = (!234 !235 !405)
1340-
!407 = span !184 89913 89914
1340+
!407 = span !184 90107 90108
13411341
!408 = (!234 !235 !407)
1342-
!409 = span !184 89913 89919
1343-
!410 = fn_call_path_span !184 89915 89917
1342+
!409 = span !184 90107 90113
1343+
!410 = fn_call_path_span !184 90109 90111
13441344
!411 = (!234 !235 !409 !410)
13451345
!412 = (!234 !235 !409 !410)
1346-
!413 = span !184 89918 89919
1346+
!413 = span !184 90112 90113
13471347
!414 = (!234 !235 !409 !410)
13481348
!415 = span !28 1322 1326
13491349
!416 = (!234 !235 !409 !410 !415)
@@ -1354,7 +1354,7 @@ script {
13541354
!421 = (!234 !235 !409 !410)
13551355
!422 = (!234 !235 !409)
13561356
!423 = (!234 !235 !409)
1357-
!424 = span !184 89941 89946
1357+
!424 = span !184 90135 90140
13581358
!425 = (!234 !235 !424)
13591359
!426 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/logging.sw"
13601360
!427 = span !426 591 596

test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ script {
226226
!18 = span !3 71305 71311
227227
!19 = span !3 71291 71312
228228
!20 = fn_call_path_span !3 71291 71304
229-
!21 = span !3 114976 114997
230-
!22 = fn_call_path_span !3 114976 114989
229+
!21 = span !3 115350 115371
230+
!22 = fn_call_path_span !3 115350 115363
231231
!23 = span !3 71904 71932
232232
!24 = fn_call_path_span !3 71911 71923
233233
!25 = span !3 625 637
@@ -241,7 +241,7 @@ script {
241241
!33 = (!19 !20 !21 !22 !23 !24)
242242
!34 = span !3 2857 2896
243243
!35 = (!19 !20 !21 !22 !23 !24 !34)
244-
!36 = span !3 114975 115000
244+
!36 = span !3 115349 115374
245245
!37 = (!19 !20 !36)
246246
!38 = (!19 !20 !36)
247247
!39 = (!19 !20 !36)

test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap

Lines changed: 61 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,81 @@
22
source: test/src/snapshot/mod.rs
33
---
44
> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call --release --experimental const_generics
5-
exit status: 0
5+
exit status: 101
66
output:
77
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
88
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
99
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
10-
Finished release [optimized + fuel] target(s) [40.528 KB] in ???
10+
Finished release [optimized + fuel] target(s) [38.76 KB] in ???
1111
Running 29 tests, filtered 0 tests
1212

1313
tested -- const_of_contract_call
1414

15-
test cost_of_in_bool ... ok (???, 2590 gas)
16-
test cost_of_in_u8 ... ok (???, 4829 gas)
17-
test cost_of_in_u16 ... ok (???, 4446 gas)
18-
test cost_of_in_u32 ... ok (???, 4879 gas)
19-
test cost_of_in_u64 ... ok (???, 4888 gas)
20-
test cost_of_in_u256 ... ok (???, 4730 gas)
21-
test cost_of_in_b256 ... ok (???, 2460 gas)
22-
test cost_of_in_str_0 ... ok (???, 2997 gas)
23-
test cost_of_in_str_1 ... ok (???, 3299 gas)
24-
test cost_of_in_str_8 ... ok (???, 3720 gas)
25-
test cost_of_in_str_16 ... ok (???, 3330 gas)
26-
test cost_of_in_str_32 ... ok (???, 3526 gas)
27-
test cost_of_in_array_0 ... ok (???, 1976 gas)
28-
test cost_of_in_array_1 ... ok (???, 3164 gas)
29-
test cost_of_in_array_8 ... ok (???, 10767 gas)
30-
test cost_of_in_array_16 ... ok (???, 16726 gas)
31-
test cost_of_in_array_32 ... ok (???, 31337 gas)
32-
test cost_of_in_array_64 ... ok (???, 60382 gas)
33-
test cost_of_in_tuple_0 ... ok (???, 3777 gas)
34-
test cost_of_in_tuple_1 ... ok (???, 4346 gas)
35-
test cost_of_in_tuple_2 ... ok (???, 4711 gas)
36-
test cost_of_in_tuple_3 ... ok (???, 5058 gas)
37-
test cost_of_in_tuple_4 ... ok (???, 5422 gas)
38-
test in_struct_u64 ... ok (???, 3589 gas)
39-
test in_struct_u64_u64 ... ok (???, 3847 gas)
40-
test in_struct_u64_u64_u64 ... ok (???, 4110 gas)
41-
test in_enum_u64 ... ok (???, 3149 gas)
42-
test in_enum_u64_u64 ... ok (???, 3020 gas)
43-
test in_enum_u64_u64_u64 ... ok (???, 3130 gas)
44-
45-
test result: OK. 29 passed; 0 failed; finished in ???
15+
test cost_of_in_bool ... ok (???, 2627 gas)
16+
test cost_of_in_u8 ... ok (???, 4874 gas)
17+
test cost_of_in_u16 ... ok (???, 4493 gas)
18+
test cost_of_in_u32 ... ok (???, 4926 gas)
19+
test cost_of_in_u64 ... ok (???, 4934 gas)
20+
test cost_of_in_u256 ... ok (???, 4777 gas)
21+
test cost_of_in_b256 ... ok (???, 2491 gas)
22+
test cost_of_in_str_0 ... ok (???, 3043 gas)
23+
test cost_of_in_str_1 ... ok (???, 3345 gas)
24+
test cost_of_in_str_8 ... ok (???, 3768 gas)
25+
test cost_of_in_str_16 ... ok (???, 3374 gas)
26+
test cost_of_in_str_32 ... ok (???, 3572 gas)
27+
test cost_of_in_array_0 ... FAILED (???, 1632 gas)
28+
test cost_of_in_array_1 ... ok (???, 2125 gas)
29+
test cost_of_in_array_8 ... ok (???, 4724 gas)
30+
test cost_of_in_array_16 ... ok (???, 5096 gas)
31+
test cost_of_in_array_32 ... ok (???, 8421 gas)
32+
test cost_of_in_array_64 ... ok (???, 14895 gas)
33+
test cost_of_in_tuple_0 ... ok (???, 3822 gas)
34+
test cost_of_in_tuple_1 ... ok (???, 4392 gas)
35+
test cost_of_in_tuple_2 ... ok (???, 4761 gas)
36+
test cost_of_in_tuple_3 ... ok (???, 5104 gas)
37+
test cost_of_in_tuple_4 ... ok (???, 5468 gas)
38+
test in_struct_u64 ... ok (???, 3635 gas)
39+
test in_struct_u64_u64 ... ok (???, 3897 gas)
40+
test in_struct_u64_u64_u64 ... ok (???, 4156 gas)
41+
test in_enum_u64 ... ok (???, 3186 gas)
42+
test in_enum_u64_u64 ... ok (???, 3061 gas)
43+
test in_enum_u64_u64_u64 ... ok (???, 3173 gas)
44+
45+
failures:
46+
test cost_of_in_array_0, "test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw":347
47+
revert code: 0
48+
49+
50+
51+
test result: FAILED. 28 passed; 1 failed; finished in ???
4652

4753
Finished in ???
54+
error: Some tests failed.
4855

4956
> Block: ARRAY0
5057
> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call --release --experimental const_generics
51-
exit status: 0
58+
exit status: 101
5259
output:
5360
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
5461
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
5562
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
56-
Finished release [optimized + fuel] target(s) [2.784 KB] in ???
63+
Finished release [optimized + fuel] target(s) [2.448 KB] in ???
5764
Running 1 test, filtered 0 tests
5865

5966
tested -- const_of_contract_call
6067

61-
test cost_of_in_array_0 ... ok (???, 1664 gas)
68+
test cost_of_in_array_0 ... FAILED (???, 1262 gas)
69+
70+
failures:
71+
test cost_of_in_array_0, "test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw":175
72+
revert code: 0
6273

63-
test result: OK. 1 passed; 0 failed; finished in ???
74+
75+
76+
test result: FAILED. 0 passed; 1 failed; finished in ???
6477

6578
Finished in ???
79+
error: Some tests failed.
6680

6781
> Block: ARRAY1
6882
> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call --release --experimental const_generics
@@ -71,12 +85,12 @@ output:
7185
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
7286
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
7387
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
74-
Finished release [optimized + fuel] target(s) [2.968 KB] in ???
88+
Finished release [optimized + fuel] target(s) [2.624 KB] in ???
7589
Running 1 test, filtered 0 tests
7690

7791
tested -- const_of_contract_call
7892

79-
test cost_of_in_array_1 ... ok (???, 2630 gas)
93+
test cost_of_in_array_1 ... ok (???, 1515 gas)
8094

8195
test result: OK. 1 passed; 0 failed; finished in ???
8296

@@ -89,12 +103,12 @@ output:
89103
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
90104
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
91105
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
92-
Finished release [optimized + fuel] target(s) [2.992 KB] in ???
106+
Finished release [optimized + fuel] target(s) [2.648 KB] in ???
93107
Running 1 test, filtered 0 tests
94108

95109
tested -- const_of_contract_call
96110

97-
test cost_of_in_array_16 ... ok (???, 15867 gas)
111+
test cost_of_in_array_16 ... ok (???, 3955 gas)
98112

99113
test result: OK. 1 passed; 0 failed; finished in ???
100114

@@ -107,12 +121,12 @@ output:
107121
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
108122
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
109123
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
110-
Finished release [optimized + fuel] target(s) [2.992 KB] in ???
124+
Finished release [optimized + fuel] target(s) [2.648 KB] in ???
111125
Running 1 test, filtered 0 tests
112126

113127
tested -- const_of_contract_call
114128

115-
test cost_of_in_array_32 ... ok (???, 29967 gas)
129+
test cost_of_in_array_32 ... ok (???, 6544 gas)
116130

117131
test result: OK. 1 passed; 0 failed; finished in ???
118132

@@ -125,12 +139,12 @@ output:
125139
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
126140
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
127141
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
128-
Finished release [optimized + fuel] target(s) [3.192 KB] in ???
142+
Finished release [optimized + fuel] target(s) [2.848 KB] in ???
129143
Running 1 test, filtered 0 tests
130144

131145
tested -- const_of_contract_call
132146

133-
test cost_of_in_array_64 ... ok (???, 58218 gas)
147+
test cost_of_in_array_64 ... ok (???, 11787 gas)
134148

135149
test result: OK. 1 passed; 0 failed; finished in ???
136150

@@ -143,12 +157,12 @@ output:
143157
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
144158
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
145159
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
146-
Finished release [optimized + fuel] target(s) [3.12 KB] in ???
160+
Finished release [optimized + fuel] target(s) [2.784 KB] in ???
147161
Running 1 test, filtered 0 tests
148162

149163
tested -- const_of_contract_call
150164

151-
test cost_of_in_array_8 ... ok (???, 9566 gas)
165+
test cost_of_in_array_8 ... ok (???, 3225 gas)
152166

153167
test result: OK. 1 passed; 0 failed; finished in ???
154168

test/src/snapshot/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ pub(super) async fn run(filter_regex: Option<&regex::Regex>) -> Result<()> {
7474
Trial::test(name.clone(), move || {
7575
let snapshot_toml =
7676
std::fs::read_to_string(format!("{}/snapshot.toml", dir.display()))?;
77-
let snapshot_toml = if snapshot_toml.is_empty() {
78-
"cmds = [ \"forc build --path {root}\"]".to_string()
77+
let snapshot_toml = if snapshot_toml.trim().is_empty() {
78+
"cmds = [ \"forc build --path {root}\" ]".to_string()
7979
} else {
8080
snapshot_toml
8181
};

0 commit comments

Comments
 (0)