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} ;
@@ -13,66 +14,19 @@ fn basic() {
1314 . assert ( )
1415 . code ( 0 ) ;
1516
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- ) ;
17+ assert_cleaned_output ! ( output) ;
4018}
4119
4220#[ test]
4321fn recursive_calls ( ) {
4422 let temp = setup_package ( "debugging" ) ;
45-
4623 let output = test_runner ( & temp)
47- . arg ( "test_debugging_trace_success" )
4824 . arg ( "--gas-report" )
25+ . arg ( "test_debugging_trace_success" )
4926 . assert ( )
5027 . code ( 0 ) ;
5128
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- ) ;
29+ assert_cleaned_output ! ( output) ;
7630}
7731
7832#[ test]
@@ -84,38 +38,7 @@ fn multiple_contracts_and_constructor() {
8438 . assert ( )
8539 . code ( 0 ) ;
8640
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- ) ;
41+ assert_cleaned_output ! ( output) ;
11942}
12043
12144#[ test]
@@ -124,44 +47,12 @@ fn fork() {
12447 setup_package_with_file_patterns ( Package :: Name ( "forking" . to_string ( ) ) , BASE_FILE_PATTERNS ) ;
12548
12649 let output = test_runner ( & temp)
127- . arg ( "test_track_resources" )
12850 . arg ( "--gas-report" )
51+ . arg ( "test_track_resources" )
12952 . assert ( )
13053 . code ( 0 ) ;
13154
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- ) ;
55+ assert_cleaned_output ! ( output) ;
16556}
16657
16758#[ test]
0 commit comments