@@ -79,8 +79,8 @@ pub struct TestArgs {
7979 ///
8080 /// If the matching test is a fuzz test, then it will open the debugger on the first failure
8181 /// case. If the fuzz test does not fail, it will open the debugger on the last fuzz case.
82- #[ arg( long, conflicts_with_all = [ "flamegraph" , "flamechart" , "decode_internal" , "rerun" ] , value_name = "DEPRECATED_TEST_FUNCTION_REGEX" ) ]
83- debug : Option < Option < Regex > > ,
82+ #[ arg( long, conflicts_with_all = [ "flamegraph" , "flamechart" , "decode_internal" , "rerun" ] ) ]
83+ debug : bool ,
8484
8585 /// Generate a flamegraph for a single test. Implies `--decode-internal`.
8686 ///
@@ -102,8 +102,8 @@ pub struct TestArgs {
102102 ///
103103 /// Parameters stored in memory (such as bytes or arrays) are currently decoded only when a
104104 /// single function is matched, similarly to `--debug`, for performance reasons.
105- #[ arg( long, value_name = "DEPRECATED_TEST_FUNCTION_REGEX" ) ]
106- decode_internal : Option < Option < Regex > > ,
105+ #[ arg( long) ]
106+ decode_internal : bool ,
107107
108108 /// Dumps all debugger steps to file.
109109 #[ arg(
@@ -288,7 +288,7 @@ impl TestArgs {
288288 // Set up the project.
289289 let project = config. project ( ) ?;
290290
291- let mut filter = self . filter ( & config) ;
291+ let filter = self . filter ( & config) ;
292292 trace ! ( target: "forge::test" , ?filter, "using filter" ) ;
293293
294294 let sources_to_compile = self . get_sources_to_compile ( & config, & filter) ?;
@@ -312,7 +312,7 @@ impl TestArgs {
312312 }
313313 }
314314
315- let should_debug = self . debug . is_some ( ) ;
315+ let should_debug = self . debug ;
316316 let should_draw = self . flamegraph || self . flamechart ;
317317
318318 // Determine print verbosity and executor verbosity.
@@ -324,12 +324,12 @@ impl TestArgs {
324324 let env = evm_opts. evm_env ( ) . await ?;
325325
326326 // Enable internal tracing for more informative flamegraph.
327- if should_draw && self . decode_internal . is_none ( ) {
328- self . decode_internal = Some ( None ) ;
327+ if should_draw && ! self . decode_internal {
328+ self . decode_internal = true ;
329329 }
330330
331331 // Choose the internal function tracing mode, if --decode-internal is provided.
332- let decode_internal = if self . decode_internal . is_some ( ) {
332+ let decode_internal = if self . decode_internal {
333333 // If more than one function matched, we enable simple tracing.
334334 // If only one function matched, we enable full tracing. This is done in `run_tests`.
335335 InternalTraceMode :: Simple
@@ -350,28 +350,6 @@ impl TestArgs {
350350 . odyssey ( evm_opts. odyssey )
351351 . build :: < MultiCompiler > ( project_root, & output, env, evm_opts) ?;
352352
353- let mut maybe_override_mt = |flag, maybe_regex : Option < & Option < Regex > > | {
354- if let Some ( Some ( regex) ) = maybe_regex {
355- sh_warn ! (
356- "specifying argument for --{flag} is deprecated and will be removed in the future, \
357- use --match-test instead"
358- ) ?;
359-
360- let test_pattern = & mut filter. args_mut ( ) . test_pattern ;
361- if test_pattern. is_some ( ) {
362- eyre:: bail!(
363- "Cannot specify both --{flag} and --match-test. \
364- Use --match-contract and --match-path to further limit the search instead."
365- ) ;
366- }
367- * test_pattern = Some ( regex. clone ( ) ) ;
368- }
369-
370- Ok ( ( ) )
371- } ;
372- maybe_override_mt ( "debug" , self . debug . as_ref ( ) ) ?;
373- maybe_override_mt ( "decode-internal" , self . decode_internal . as_ref ( ) ) ?;
374-
375353 let libraries = runner. libraries . clone ( ) ;
376354 let mut outcome = self . run_tests ( runner, config, verbosity, & filter, & output) . await ?;
377355
@@ -466,7 +444,7 @@ impl TestArgs {
466444 let silent = self . gas_report && shell:: is_json ( ) || self . summary && shell:: is_json ( ) ;
467445
468446 let num_filtered = runner. matching_test_functions ( filter) . count ( ) ;
469- if num_filtered != 1 && ( self . debug . is_some ( ) || self . flamegraph || self . flamechart ) {
447+ if num_filtered != 1 && ( self . debug || self . flamegraph || self . flamechart ) {
470448 let action = if self . flamegraph {
471449 "generate a flamegraph"
472450 } else if self . flamechart {
@@ -486,7 +464,7 @@ impl TestArgs {
486464 }
487465
488466 // If exactly one test matched, we enable full tracing.
489- if num_filtered == 1 && self . decode_internal . is_some ( ) {
467+ if num_filtered == 1 && self . decode_internal {
490468 runner. decode_internal = InternalTraceMode :: Full ;
491469 }
492470
@@ -549,7 +527,7 @@ impl TestArgs {
549527 ) ?) ;
550528 }
551529
552- if self . decode_internal . is_some ( ) {
530+ if self . decode_internal {
553531 let sources =
554532 ContractSources :: from_project_output ( output, & config. root , Some ( & libraries) ) ?;
555533 builder = builder. with_debug_identifier ( DebugTraceIdentifier :: new ( sources) ) ;
@@ -578,7 +556,7 @@ impl TestArgs {
578556 // We identify addresses if we're going to print *any* trace or gas report.
579557 let identify_addresses = verbosity >= 3 ||
580558 self . gas_report ||
581- self . debug . is_some ( ) ||
559+ self . debug ||
582560 self . flamegraph ||
583561 self . flamechart ;
584562
0 commit comments