diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/macro_processor.rs | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/tests/macro_processor.rs b/tests/macro_processor.rs index 95edfeb..cb21df5 100644 --- a/tests/macro_processor.rs +++ b/tests/macro_processor.rs @@ -2,7 +2,9 @@ use skaldpress::macro_processor::MacroProcessor; fn run_macro_processor(input: &str) -> String { let mut macro_processor = MacroProcessor::new(); - macro_processor.process_input(&input) + macro_processor + .process_input(&input) + .expect("macro processing failed") } #[test] @@ -48,7 +50,7 @@ fn test_smp_define_2() { fn test_smp_dnl_1() { assert_eq!( run_macro_processor( - "SNNL + "DNL test" ), "test", @@ -59,7 +61,7 @@ test" fn test_smp_dnl_2() { assert_eq!( run_macro_processor( - "SNNL + "DNL this is some random text that should not be included test" ), "test", @@ -70,6 +72,50 @@ test" fn test_smp_dnl_3() { assert_eq!( run_macro_processor( + "DNL ifdef(a, b, c) +test" + ), + "test", + ); +} + +#[test] +fn test_smp_dnl_4() { + assert_eq!( + run_macro_processor( + "DNL +test" + ), + "test", + ); +} + +#[test] +fn test_smp_snnl_1() { + assert_eq!( + run_macro_processor( + "SNNL +test" + ), + "test", + ); +} + +#[test] +fn test_smp_snnl_2() { + assert_eq!( + run_macro_processor( + "SNNL +test" + ), + "test", + ); +} + +#[test] +fn test_smp_snnl_3() { + assert_eq!( + run_macro_processor( "define(MAC1, test)SNNL MAC1 SNNL test" |