1+ use crate :: assert_cleaned_output;
12use crate :: e2e:: common:: runner:: {
23 BASE_FILE_PATTERNS , Package , setup_package, setup_package_with_file_patterns, test_runner,
34} ;
4- use indoc:: indoc;
5- use shared:: test_utils:: output_assert:: assert_stdout_contains;
65
76#[ test]
87fn basic ( ) {
@@ -13,66 +12,19 @@ fn basic() {
1312 . assert ( )
1413 . code ( 0 ) ;
1514
16- assert_stdout_contains (
17- output,
18- indoc ! { r"
19- [..]Compiling[..]
20- [..]Finished[..]
21-
22-
23- Collected 1 test(s) from simple_package package
24- Running 0 test(s) from src/
25- Running 1 test(s) from tests/
26- [PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~[..], l2_gas: ~[..])
27- ╭------------------------+-------+-------+-------+---------+---------╮
28- | HelloStarknet Contract | | | | | |
29- +====================================================================+
30- | Function Name | Min | Max | Avg | Std Dev | # Calls |
31- |------------------------+-------+-------+-------+---------+---------|
32- | get_balance | 13340 | 13340 | 13340 | 0 | 2 |
33- |------------------------+-------+-------+-------+---------+---------|
34- | increase_balance | 24940 | 24940 | 24940 | 0 | 1 |
35- ╰------------------------+-------+-------+-------+---------+---------╯
36-
37- Tests: 1 passed, 0 failed, 0 ignored, [..] filtered out
38- " } ,
39- ) ;
15+ assert_cleaned_output ! ( output) ;
4016}
4117
4218#[ test]
4319fn recursive_calls ( ) {
4420 let temp = setup_package ( "debugging" ) ;
45-
4621 let output = test_runner ( & temp)
47- . arg ( "test_debugging_trace_success" )
4822 . arg ( "--gas-report" )
23+ . arg ( "test_debugging_trace_success" )
4924 . assert ( )
5025 . code ( 0 ) ;
5126
52- assert_stdout_contains (
53- output,
54- indoc ! { r"
55- [..]Compiling[..]
56- [..]Finished[..]
57-
58-
59- Collected 1 test(s) from debugging package
60- Running 0 test(s) from src/
61- Running 1 test(s) from tests/
62- [PASS] debugging_integrationtest::test_trace::test_debugging_trace_success (l1_gas: ~0, l1_data_gas: ~[..], l2_gas: ~[..])
63- ╭-------------------------+-------+--------+--------+---------+---------╮
64- | SimpleContract Contract | | | | | |
65- +=======================================================================+
66- | Function Name | Min | Max | Avg | Std Dev | # Calls |
67- |-------------------------+-------+--------+--------+---------+---------|
68- | execute_calls | 11680 | 609080 | 183924 | 235859 | 5 |
69- |-------------------------+-------+--------+--------+---------+---------|
70- | fail | 17950 | 17950 | 17950 | 0 | 1 |
71- ╰-------------------------+-------+--------+--------+---------+---------╯
72-
73- Tests: 1 passed, 0 failed, 0 ignored, [..] filtered out
74- " } ,
75- ) ;
27+ assert_cleaned_output ! ( output) ;
7628}
7729
7830#[ test]
@@ -84,38 +36,7 @@ fn multiple_contracts_and_constructor() {
8436 . assert ( )
8537 . code ( 0 ) ;
8638
87- assert_stdout_contains (
88- output,
89- indoc ! { r"
90- [..]Compiling[..]
91- [..]Finished[..]
92-
93-
94- Collected 1 test(s) from simple_package_with_cheats package
95- Running 0 test(s) from src/
96- Running 1 test(s) from tests/
97- [PASS] simple_package_with_cheats_integrationtest::contract::call_and_invoke_proxy (l1_gas: ~0, l1_data_gas: ~[..], l2_gas: ~[..])
98- ╭------------------------+-------+-------+-------+---------+---------╮
99- | HelloStarknet Contract | | | | | |
100- +====================================================================+
101- | Function Name | Min | Max | Avg | Std Dev | # Calls |
102- |------------------------+-------+-------+-------+---------+---------|
103- | get_block_number | 15780 | 15780 | 15780 | 0 | 2 |
104- ╰------------------------+-------+-------+-------+---------+---------╯
105-
106- ╭-----------------------------+--------+--------+--------+---------+---------╮
107- | HelloStarknetProxy Contract | | | | | |
108- +============================================================================+
109- | Function Name | Min | Max | Avg | Std Dev | # Calls |
110- |-----------------------------+--------+--------+--------+---------+---------|
111- | constructor | 14650 | 14650 | 14650 | 0 | 1 |
112- |-----------------------------+--------+--------+--------+---------+---------|
113- | get_block_number | 125280 | 125280 | 125280 | 0 | 2 |
114- ╰-----------------------------+--------+--------+--------+---------+---------╯
115-
116- Tests: 1 passed, 0 failed, 0 ignored, [..] filtered out
117- " } ,
118- ) ;
39+ assert_cleaned_output ! ( output) ;
11940}
12041
12142#[ test]
@@ -124,44 +45,12 @@ fn fork() {
12445 setup_package_with_file_patterns ( Package :: Name ( "forking" . to_string ( ) ) , BASE_FILE_PATTERNS ) ;
12546
12647 let output = test_runner ( & temp)
127- . arg ( "test_track_resources" )
12848 . arg ( "--gas-report" )
49+ . arg ( "test_track_resources" )
12950 . assert ( )
13051 . code ( 0 ) ;
13152
132- assert_stdout_contains (
133- output,
134- indoc ! { r"
135- [..]Compiling[..]
136- [..]Finished[..]
137-
138- Collected 1 test(s) from forking package
139- Running 1 test(s) from src/
140- [PASS] forking::tests::test_track_resources (l1_gas: ~0, l1_data_gas: ~[..], l2_gas: ~[..])
141- ╭---------------------------+-------+-------+-------+---------+---------╮
142- | forked contract | | | | | |
143- | (class hash: 0x06a7…1550) | | | | | |
144- +=======================================================================+
145- | Function Name | Min | Max | Avg | Std Dev | # Calls |
146- |---------------------------+-------+-------+-------+---------+---------|
147- | get_balance | 40000 | 40000 | 40000 | 0 | 1 |
148- |---------------------------+-------+-------+-------+---------+---------|
149- | increase_balance | 40000 | 40000 | 40000 | 0 | 1 |
150- ╰---------------------------+-------+-------+-------+---------+---------╯
151- ╭---------------------------+-------+-------+-------+---------+---------╮
152- | forked contract | | | | | |
153- | (class hash: 0x07aa…af4b) | | | | | |
154- +=======================================================================+
155- | Function Name | Min | Max | Avg | Std Dev | # Calls |
156- |---------------------------+-------+-------+-------+---------+---------|
157- | get_balance | 13840 | 13840 | 13840 | 0 | 1 |
158- |---------------------------+-------+-------+-------+---------+---------|
159- | increase_balance | 25840 | 25840 | 25840 | 0 | 1 |
160- ╰---------------------------+-------+-------+-------+---------+---------╯
161-
162- Tests: 1 passed, 0 failed, 0 ignored, [..] filtered out
163- " } ,
164- ) ;
53+ assert_cleaned_output ! ( output) ;
16554}
16655
16756#[ test]
0 commit comments