From ca6571d9d3f1d1961e23691837feb430cbbd0e24 Mon Sep 17 00:00:00 2001 From: Qrius Date: Thu, 26 Sep 2024 00:11:05 +0200 Subject: Add special DNL macro, do a bunch of skaldpress-stuff --- tests/macro_processor.rs | 52 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) (limited to 'tests') 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", @@ -68,6 +70,50 @@ test" #[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 -- cgit v1.2.3