@@ -2,7 +2,7 @@ use super::{AttributeInfo, ErrorExt, internal_config_statement::InternalConfigSt
22use crate :: asserts:: assert_is_used_once;
33use crate :: common:: { has_fuzzer_attribute, has_test_case_attribute} ;
44use crate :: external_inputs:: ExternalInput ;
5- use crate :: utils:: create_single_token;
5+ use crate :: utils:: { create_single_token, process_statements } ;
66use crate :: {
77 args:: Arguments ,
88 common:: { into_proc_macro_result, with_parsed_values} ,
@@ -81,9 +81,6 @@ fn test_internal(
8181 let signature = SyntaxNodeWithDb :: new ( & signature, db) ;
8282 let signature = quote ! { #signature } ;
8383
84- let body = func. body ( db) . as_syntax_node ( ) ;
85- let body = SyntaxNodeWithDb :: new ( & body, db) ;
86-
8784 let attributes = func. attributes ( db) . as_syntax_node ( ) ;
8885 let attributes = SyntaxNodeWithDb :: new ( & attributes, db) ;
8986
@@ -98,13 +95,27 @@ fn test_internal(
9895
9996 let test_func_with_attrs = test_func_with_attrs ( & test_func, & called_func, & call_args) ;
10097
98+ let statements = func
99+ . body ( db)
100+ . statements ( db)
101+ . elements ( db)
102+ . collect :: < Vec < _ > > ( ) ;
103+ let ( statements, if_content) = process_statements ( db, & statements) ;
104+
101105 Ok ( quote ! (
102106 #test_func_with_attrs
103107
104108 #attributes
105- #[ #internal_config]
106109 fn #func_ident #signature
107- #body
110+ {
111+ if snforge_std:: _internals:: is_config_run( ) {
112+ #if_content
113+
114+ return ;
115+ }
116+
117+ #statements
118+ }
108119 ) )
109120 } else {
110121 Ok ( quote ! (
0 commit comments