File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
crates/artifacts/solc/src Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2229,4 +2229,21 @@ mod tests {
22292229 let content = fs:: read_to_string ( path) . unwrap ( ) ;
22302230 let _output: CompilerOutput = serde_json:: from_str ( & content) . unwrap ( ) ;
22312231 }
2232+
2233+ // <https://github.com/foundry-rs/foundry/issues/9322>
2234+ #[ test]
2235+ fn can_sanitize_optimizer_inliner ( ) {
2236+ let version: Version = "0.8.4" . parse ( ) . unwrap ( ) ;
2237+ let settings = Settings :: default ( ) . with_via_ir_minimum_optimization ( ) ;
2238+
2239+ let input =
2240+ SolcInput { language : SolcLanguage :: Solidity , sources : Default :: default ( ) , settings } ;
2241+
2242+ let i = input. clone ( ) . sanitized ( & version) ;
2243+ assert ! ( i. settings. optimizer. details. unwrap( ) . inliner. is_none( ) ) ;
2244+
2245+ let i = input. sanitized ( & Version :: new ( 0 , 8 , 5 ) ) ;
2246+ assert_eq ! ( i. settings. optimizer. details. unwrap( ) . inliner, Some ( false ) ) ;
2247+
2248+ }
22322249}
You can’t perform that action at this time.
0 commit comments