Skip to content

Commit 48bde8c

Browse files
committed
Add Json test
1 parent a40b59c commit 48bde8c

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

crates/forge/tests/cli/cmd.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2897,4 +2897,54 @@ Suite result: ok. 1 passed; 0 failed; 0 skipped; [ELAPSED]
28972897
...
28982898
28992899
"#]]);
2900+
2901+
cmd.forge_fuse()
2902+
.args(["test", "--mt", "test_fallback_gas_report", "--gas-report", "--json"])
2903+
.assert_success()
2904+
.stdout_eq(
2905+
str![[r#"
2906+
[
2907+
{
2908+
"contract": "test/DelegateProxyTest.sol:DelegateProxy",
2909+
"deployment": {
2910+
"gas": 108698,
2911+
"size": 315
2912+
},
2913+
"functions": {
2914+
"deposit()": {
2915+
"calls": 1,
2916+
"min": 21160,
2917+
"mean": 21160,
2918+
"median": 21160,
2919+
"max": 21160
2920+
},
2921+
"fallback()": {
2922+
"calls": 1,
2923+
"min": 29396,
2924+
"mean": 29396,
2925+
"median": 29396,
2926+
"max": 29396
2927+
}
2928+
}
2929+
},
2930+
{
2931+
"contract": "test/DelegateProxyTest.sol:ProxiedContract",
2932+
"deployment": {
2933+
"gas": 106511,
2934+
"size": 276
2935+
},
2936+
"functions": {
2937+
"deposit(uint256)": {
2938+
"calls": 1,
2939+
"min": 3320,
2940+
"mean": 3320,
2941+
"median": 3320,
2942+
"max": 3320
2943+
}
2944+
}
2945+
}
2946+
]
2947+
"#]]
2948+
.is_json(),
2949+
);
29002950
});

0 commit comments

Comments
 (0)