diff options
author | Qrius <[email protected]> | 2024-09-26 00:11:05 +0200 |
---|---|---|
committer | Qrius <[email protected]> | 2024-09-26 00:11:05 +0200 |
commit | ca6571d9d3f1d1961e23691837feb430cbbd0e24 (patch) | |
tree | ea3a2607dc42e55b1117807075785890ed3d1974 /tests/macro_processor.rs | |
parent | e6ab276a4d5daaf0dd40eed5e2ff477b48187f77 (diff) | |
download | skaldpress-ca6571d9d3f1d1961e23691837feb430cbbd0e24.tar.gz skaldpress-ca6571d9d3f1d1961e23691837feb430cbbd0e24.zip |
Add special DNL macro, do a bunch of skaldpress-stuff
Diffstat (limited to 'tests/macro_processor.rs')
-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" |