From 313e059f367f2ac291cd409e77d22673f9595848 Mon Sep 17 00:00:00 2001 From: Qrius Date: Wed, 5 Mar 2025 08:41:05 +0100 Subject: First iteration of py skaldpress version --- tests/input_files/array_each_1 | 7 ------- tests/input_files/array_push_1 | 5 ----- tests/input_files/array_push_2 | 5 ----- tests/input_files/array_push_3 | 8 -------- tests/input_files/define_1 | 5 ----- tests/input_files/define_2 | 3 --- tests/input_files/dnl_1 | 4 ---- tests/input_files/dnl_2 | 4 ---- tests/input_files/dnl_3 | 4 ---- tests/input_files/dnl_4 | 4 ---- tests/input_files/explode_1 | 5 ----- tests/input_files/explode_2 | 6 ------ tests/input_files/format_time_1 | 3 --- tests/input_files/ifdef_1 | 6 ------ tests/input_files/ifdef_2 | 3 --- tests/input_files/ifdef_3 | 3 --- tests/input_files/ifeq_1 | 3 --- tests/input_files/ifeq_2 | 3 --- tests/input_files/ifeq_3 | 3 --- tests/input_files/ifeq_4 | 3 --- tests/input_files/ifndef_1 | 3 --- tests/input_files/ifndef_2 | 4 ---- tests/input_files/ifndef_3 | 4 ---- tests/input_files/ifneq_1 | 3 --- tests/input_files/ifneq_2 | 3 --- tests/input_files/ifneq_3 | 3 --- tests/input_files/ifneq_4 | 3 --- tests/input_files/include_1 | 3 --- tests/input_files/include_2 | 4 ---- tests/input_files/markdown_html_1 | 5 ----- tests/input_files/markdown_html_2 | 5 ----- tests/input_files/non_macro_html | 7 ------- tests/input_files/shell_1 | 3 --- tests/input_files/snnl_1 | 4 ---- tests/input_files/snnl_2 | 4 ---- tests/input_files/snnl_3 | 5 ----- tests/input_files/whitespace_deleting_1 | 3 --- tests/input_files/whitespace_deleting_2 | 3 --- tests/input_files/wodl_1 | 3 --- tests/input_files/wodl_2 | 3 --- tests/skaldpress/content/article.md | 11 +++++++++++ tests/skaldpress/templates/article.html | 22 ++++++++++++++++++++++ tests/skaldpress/templates/base.html | 14 ++++++++++++++ tests/smp/array_each_1 | 7 +++++++ tests/smp/array_push_1 | 5 +++++ tests/smp/array_push_2 | 5 +++++ tests/smp/array_push_3 | 8 ++++++++ tests/smp/define_1 | 5 +++++ tests/smp/define_2 | 3 +++ tests/smp/dnl_1 | 4 ++++ tests/smp/dnl_2 | 4 ++++ tests/smp/dnl_3 | 4 ++++ tests/smp/dnl_4 | 4 ++++ tests/smp/explode_1 | 5 +++++ tests/smp/explode_2 | 6 ++++++ tests/smp/format_time_1 | 3 +++ tests/smp/ifdef_1 | 6 ++++++ tests/smp/ifdef_2 | 3 +++ tests/smp/ifdef_3 | 3 +++ tests/smp/ifeq_1 | 3 +++ tests/smp/ifeq_2 | 3 +++ tests/smp/ifeq_3 | 3 +++ tests/smp/ifeq_4 | 3 +++ tests/smp/ifndef_1 | 3 +++ tests/smp/ifndef_2 | 4 ++++ tests/smp/ifndef_3 | 4 ++++ tests/smp/ifneq_1 | 3 +++ tests/smp/ifneq_2 | 3 +++ tests/smp/ifneq_3 | 3 +++ tests/smp/ifneq_4 | 3 +++ tests/smp/include_1 | 3 +++ tests/smp/include_2 | 4 ++++ tests/smp/markdown_html_1 | 5 +++++ tests/smp/markdown_html_2 | 5 +++++ tests/smp/non_macro_html | 7 +++++++ tests/smp/shell_1 | 3 +++ tests/smp/snnl_1 | 4 ++++ tests/smp/snnl_2 | 4 ++++ tests/smp/snnl_3 | 5 +++++ tests/smp/whitespace_deleting_1 | 3 +++ tests/smp/whitespace_deleting_2 | 3 +++ tests/smp/wodl_1 | 3 +++ tests/smp/wodl_2 | 3 +++ tests/test_macro_processor.sh | 4 ++-- tests/test_skaldpress.sh | 7 +++++++ tests/test_unittests.sh | 27 +++++++++++++++++++++++++++ tests/unit_tests/metadata_parser_1.py | 28 ++++++++++++++++++++++++++++ 87 files changed, 273 insertions(+), 164 deletions(-) delete mode 100644 tests/input_files/array_each_1 delete mode 100644 tests/input_files/array_push_1 delete mode 100644 tests/input_files/array_push_2 delete mode 100644 tests/input_files/array_push_3 delete mode 100644 tests/input_files/define_1 delete mode 100644 tests/input_files/define_2 delete mode 100644 tests/input_files/dnl_1 delete mode 100644 tests/input_files/dnl_2 delete mode 100644 tests/input_files/dnl_3 delete mode 100644 tests/input_files/dnl_4 delete mode 100644 tests/input_files/explode_1 delete mode 100644 tests/input_files/explode_2 delete mode 100644 tests/input_files/format_time_1 delete mode 100644 tests/input_files/ifdef_1 delete mode 100644 tests/input_files/ifdef_2 delete mode 100644 tests/input_files/ifdef_3 delete mode 100644 tests/input_files/ifeq_1 delete mode 100644 tests/input_files/ifeq_2 delete mode 100644 tests/input_files/ifeq_3 delete mode 100644 tests/input_files/ifeq_4 delete mode 100644 tests/input_files/ifndef_1 delete mode 100644 tests/input_files/ifndef_2 delete mode 100644 tests/input_files/ifndef_3 delete mode 100644 tests/input_files/ifneq_1 delete mode 100644 tests/input_files/ifneq_2 delete mode 100644 tests/input_files/ifneq_3 delete mode 100644 tests/input_files/ifneq_4 delete mode 100644 tests/input_files/include_1 delete mode 100644 tests/input_files/include_2 delete mode 100644 tests/input_files/markdown_html_1 delete mode 100644 tests/input_files/markdown_html_2 delete mode 100644 tests/input_files/non_macro_html delete mode 100644 tests/input_files/shell_1 delete mode 100644 tests/input_files/snnl_1 delete mode 100644 tests/input_files/snnl_2 delete mode 100644 tests/input_files/snnl_3 delete mode 100644 tests/input_files/whitespace_deleting_1 delete mode 100644 tests/input_files/whitespace_deleting_2 delete mode 100644 tests/input_files/wodl_1 delete mode 100644 tests/input_files/wodl_2 create mode 100644 tests/skaldpress/content/article.md create mode 100644 tests/skaldpress/templates/article.html create mode 100644 tests/skaldpress/templates/base.html create mode 100644 tests/smp/array_each_1 create mode 100644 tests/smp/array_push_1 create mode 100644 tests/smp/array_push_2 create mode 100644 tests/smp/array_push_3 create mode 100644 tests/smp/define_1 create mode 100644 tests/smp/define_2 create mode 100644 tests/smp/dnl_1 create mode 100644 tests/smp/dnl_2 create mode 100644 tests/smp/dnl_3 create mode 100644 tests/smp/dnl_4 create mode 100644 tests/smp/explode_1 create mode 100644 tests/smp/explode_2 create mode 100644 tests/smp/format_time_1 create mode 100644 tests/smp/ifdef_1 create mode 100644 tests/smp/ifdef_2 create mode 100644 tests/smp/ifdef_3 create mode 100644 tests/smp/ifeq_1 create mode 100644 tests/smp/ifeq_2 create mode 100644 tests/smp/ifeq_3 create mode 100644 tests/smp/ifeq_4 create mode 100644 tests/smp/ifndef_1 create mode 100644 tests/smp/ifndef_2 create mode 100644 tests/smp/ifndef_3 create mode 100644 tests/smp/ifneq_1 create mode 100644 tests/smp/ifneq_2 create mode 100644 tests/smp/ifneq_3 create mode 100644 tests/smp/ifneq_4 create mode 100644 tests/smp/include_1 create mode 100644 tests/smp/include_2 create mode 100644 tests/smp/markdown_html_1 create mode 100644 tests/smp/markdown_html_2 create mode 100644 tests/smp/non_macro_html create mode 100644 tests/smp/shell_1 create mode 100644 tests/smp/snnl_1 create mode 100644 tests/smp/snnl_2 create mode 100644 tests/smp/snnl_3 create mode 100644 tests/smp/whitespace_deleting_1 create mode 100644 tests/smp/whitespace_deleting_2 create mode 100644 tests/smp/wodl_1 create mode 100644 tests/smp/wodl_2 create mode 100755 tests/test_skaldpress.sh create mode 100755 tests/test_unittests.sh create mode 100644 tests/unit_tests/metadata_parser_1.py (limited to 'tests') diff --git a/tests/input_files/array_each_1 b/tests/input_files/array_each_1 deleted file mode 100644 index 5844d71..0000000 --- a/tests/input_files/array_each_1 +++ /dev/null @@ -1,7 +0,0 @@ -define_array(arr)DNL -define(item, $0)DNL -array_push(arr, test)DNL -array_push(arr, tast)DNL -array_each(arr, item) ---- -testtast diff --git a/tests/input_files/array_push_1 b/tests/input_files/array_push_1 deleted file mode 100644 index fb59320..0000000 --- a/tests/input_files/array_push_1 +++ /dev/null @@ -1,5 +0,0 @@ -define_array(arr)DNL -array_push(arr, test)DNL -array_size(arr) ---- -1 diff --git a/tests/input_files/array_push_2 b/tests/input_files/array_push_2 deleted file mode 100644 index 3b4d652..0000000 --- a/tests/input_files/array_push_2 +++ /dev/null @@ -1,5 +0,0 @@ -define_array(arr)DNL -array_push(arr, test, tast, toast)DNL -array_size(arr) ---- -3 diff --git a/tests/input_files/array_push_3 b/tests/input_files/array_push_3 deleted file mode 100644 index 60417b4..0000000 --- a/tests/input_files/array_push_3 +++ /dev/null @@ -1,8 +0,0 @@ -define_array(arr)DNL -array_push(arr, test, tast, toast)DNL -array_size(arr) -array_push(arr, test, tast, toast)DNL -array_size(arr) ---- -3 -6 diff --git a/tests/input_files/define_1 b/tests/input_files/define_1 deleted file mode 100644 index 68002ea..0000000 --- a/tests/input_files/define_1 +++ /dev/null @@ -1,5 +0,0 @@ -define(TEMP, testvalue) -TEMP ---- - -testvalue diff --git a/tests/input_files/define_2 b/tests/input_files/define_2 deleted file mode 100644 index 016294a..0000000 --- a/tests/input_files/define_2 +++ /dev/null @@ -1,3 +0,0 @@ -define(TEMP, TEMP2)define(TEMP)ifdef(TEMP2, TEMP2_ISDEF) ---- -TEMP2_ISDEF diff --git a/tests/input_files/dnl_1 b/tests/input_files/dnl_1 deleted file mode 100644 index c12bc01..0000000 --- a/tests/input_files/dnl_1 +++ /dev/null @@ -1,4 +0,0 @@ -DNL -test ---- -test diff --git a/tests/input_files/dnl_2 b/tests/input_files/dnl_2 deleted file mode 100644 index 356aee9..0000000 --- a/tests/input_files/dnl_2 +++ /dev/null @@ -1,4 +0,0 @@ -DNL ifdef(a, b, c) -test ---- -test diff --git a/tests/input_files/dnl_3 b/tests/input_files/dnl_3 deleted file mode 100644 index 356aee9..0000000 --- a/tests/input_files/dnl_3 +++ /dev/null @@ -1,4 +0,0 @@ -DNL ifdef(a, b, c) -test ---- -test diff --git a/tests/input_files/dnl_4 b/tests/input_files/dnl_4 deleted file mode 100644 index 67c1c0e..0000000 --- a/tests/input_files/dnl_4 +++ /dev/null @@ -1,4 +0,0 @@ -DNL -test ---- -test diff --git a/tests/input_files/explode_1 b/tests/input_files/explode_1 deleted file mode 100644 index 79b70ba..0000000 --- a/tests/input_files/explode_1 +++ /dev/null @@ -1,5 +0,0 @@ -define_array(arr)DNL -explode(arr, |, a|b|c|d)DNL -array_size(arr) ---- -4 diff --git a/tests/input_files/explode_2 b/tests/input_files/explode_2 deleted file mode 100644 index 7ef0c08..0000000 --- a/tests/input_files/explode_2 +++ /dev/null @@ -1,6 +0,0 @@ -define_array(arr)DNL -define(item, $0)DNL -explode(arr, |, a|b|c|d)DNL -array_each(arr, item) ---- -abcd diff --git a/tests/input_files/format_time_1 b/tests/input_files/format_time_1 deleted file mode 100644 index bd9a097..0000000 --- a/tests/input_files/format_time_1 +++ /dev/null @@ -1,3 +0,0 @@ -format_time(%d %B %Y, 2024-04-04T00:00:00Z) ---- -04 April 2024 diff --git a/tests/input_files/ifdef_1 b/tests/input_files/ifdef_1 deleted file mode 100644 index a308141..0000000 --- a/tests/input_files/ifdef_1 +++ /dev/null @@ -1,6 +0,0 @@ -define(MAC1, test)SNNL -ifdef(MAC1, MAC1_ISDEF) -ifdef(MAC2, MAC2_ISDEF, MAC2_ISNDEF) ---- -MAC1_ISDEF -MAC2_ISNDEF diff --git a/tests/input_files/ifdef_2 b/tests/input_files/ifdef_2 deleted file mode 100644 index ecef66c..0000000 --- a/tests/input_files/ifdef_2 +++ /dev/null @@ -1,3 +0,0 @@ -ifdef(MAC, MAC_ISDEF) ---- - diff --git a/tests/input_files/ifdef_3 b/tests/input_files/ifdef_3 deleted file mode 100644 index 4867034..0000000 --- a/tests/input_files/ifdef_3 +++ /dev/null @@ -1,3 +0,0 @@ -ifdef(MAC, MAC_ISDEF, MAC_ISNDEF) ---- -MAC_ISNDEF diff --git a/tests/input_files/ifeq_1 b/tests/input_files/ifeq_1 deleted file mode 100644 index 3e49f68..0000000 --- a/tests/input_files/ifeq_1 +++ /dev/null @@ -1,3 +0,0 @@ -ifeq(a, a, true, false) ---- -true diff --git a/tests/input_files/ifeq_2 b/tests/input_files/ifeq_2 deleted file mode 100644 index fe7c0ac..0000000 --- a/tests/input_files/ifeq_2 +++ /dev/null @@ -1,3 +0,0 @@ -ifeq(a, b, true, false) ---- -false diff --git a/tests/input_files/ifeq_3 b/tests/input_files/ifeq_3 deleted file mode 100644 index 42646b8..0000000 --- a/tests/input_files/ifeq_3 +++ /dev/null @@ -1,3 +0,0 @@ -ifeq(a, a, true) ---- -true diff --git a/tests/input_files/ifeq_4 b/tests/input_files/ifeq_4 deleted file mode 100644 index d069530..0000000 --- a/tests/input_files/ifeq_4 +++ /dev/null @@ -1,3 +0,0 @@ -ifeq(a, b, true) ---- - diff --git a/tests/input_files/ifndef_1 b/tests/input_files/ifndef_1 deleted file mode 100644 index 857204b..0000000 --- a/tests/input_files/ifndef_1 +++ /dev/null @@ -1,3 +0,0 @@ -ifndef(MAC, MAC_ISNDEF) ---- -MAC_ISNDEF diff --git a/tests/input_files/ifndef_2 b/tests/input_files/ifndef_2 deleted file mode 100644 index fbe0ba3..0000000 --- a/tests/input_files/ifndef_2 +++ /dev/null @@ -1,4 +0,0 @@ -define(MAC, test)SNNL -ifndef(MAC, MAC_ISNDEF, MAC_ISDEF) ---- -MAC_ISDEF diff --git a/tests/input_files/ifndef_3 b/tests/input_files/ifndef_3 deleted file mode 100644 index 82a180d..0000000 --- a/tests/input_files/ifndef_3 +++ /dev/null @@ -1,4 +0,0 @@ -define(MAC, test)SNNL -ifndef(MAC, MAC_ISNDEF) ---- - diff --git a/tests/input_files/ifneq_1 b/tests/input_files/ifneq_1 deleted file mode 100644 index 5b443c5..0000000 --- a/tests/input_files/ifneq_1 +++ /dev/null @@ -1,3 +0,0 @@ -ifneq(a, a, true, false) ---- -false diff --git a/tests/input_files/ifneq_2 b/tests/input_files/ifneq_2 deleted file mode 100644 index 8145e9f..0000000 --- a/tests/input_files/ifneq_2 +++ /dev/null @@ -1,3 +0,0 @@ -ifneq(a, b, true, false) ---- -true diff --git a/tests/input_files/ifneq_3 b/tests/input_files/ifneq_3 deleted file mode 100644 index 163d871..0000000 --- a/tests/input_files/ifneq_3 +++ /dev/null @@ -1,3 +0,0 @@ -ifneq(a, a, true) ---- - diff --git a/tests/input_files/ifneq_4 b/tests/input_files/ifneq_4 deleted file mode 100644 index c93a572..0000000 --- a/tests/input_files/ifneq_4 +++ /dev/null @@ -1,3 +0,0 @@ -ifneq(a, b, true) ---- -true diff --git a/tests/input_files/include_1 b/tests/input_files/include_1 deleted file mode 100644 index 1621de2..0000000 --- a/tests/input_files/include_1 +++ /dev/null @@ -1,3 +0,0 @@ -include(tests/example_include.smp) ---- - diff --git a/tests/input_files/include_2 b/tests/input_files/include_2 deleted file mode 100644 index 2714eff..0000000 --- a/tests/input_files/include_2 +++ /dev/null @@ -1,4 +0,0 @@ -include(tests/example_include.smp)SNNL -ifdef(SMP, SMP_ISDEF, SMP_ISNDEF) ---- -SMP_ISDEF diff --git a/tests/input_files/markdown_html_1 b/tests/input_files/markdown_html_1 deleted file mode 100644 index 6a9f143..0000000 --- a/tests/input_files/markdown_html_1 +++ /dev/null @@ -1,5 +0,0 @@ -html_from_markdown(%" -# Test -"%) ---- -

Test

diff --git a/tests/input_files/markdown_html_2 b/tests/input_files/markdown_html_2 deleted file mode 100644 index 6a9f143..0000000 --- a/tests/input_files/markdown_html_2 +++ /dev/null @@ -1,5 +0,0 @@ -html_from_markdown(%" -# Test -"%) ---- -

Test

diff --git a/tests/input_files/non_macro_html b/tests/input_files/non_macro_html deleted file mode 100644 index 6f49b4a..0000000 --- a/tests/input_files/non_macro_html +++ /dev/null @@ -1,7 +0,0 @@ - -

This is a test

- ---- - -

This is a test

- diff --git a/tests/input_files/shell_1 b/tests/input_files/shell_1 deleted file mode 100644 index 3eb1f14..0000000 --- a/tests/input_files/shell_1 +++ /dev/null @@ -1,3 +0,0 @@ -shell(printf test) ---- -test diff --git a/tests/input_files/snnl_1 b/tests/input_files/snnl_1 deleted file mode 100644 index 47a10b9..0000000 --- a/tests/input_files/snnl_1 +++ /dev/null @@ -1,4 +0,0 @@ -SNNL -test ---- -test diff --git a/tests/input_files/snnl_2 b/tests/input_files/snnl_2 deleted file mode 100644 index 2fcd0ba..0000000 --- a/tests/input_files/snnl_2 +++ /dev/null @@ -1,4 +0,0 @@ -SNNL -test ---- -test diff --git a/tests/input_files/snnl_3 b/tests/input_files/snnl_3 deleted file mode 100644 index 4a7dad7..0000000 --- a/tests/input_files/snnl_3 +++ /dev/null @@ -1,5 +0,0 @@ -define(MAC1, test)SNNL -MAC1 SNNL -test ---- -test test diff --git a/tests/input_files/whitespace_deleting_1 b/tests/input_files/whitespace_deleting_1 deleted file mode 100644 index ccda45f..0000000 --- a/tests/input_files/whitespace_deleting_1 +++ /dev/null @@ -1,3 +0,0 @@ -define(a, b) a ---- - b diff --git a/tests/input_files/whitespace_deleting_2 b/tests/input_files/whitespace_deleting_2 deleted file mode 100644 index 8777c39..0000000 --- a/tests/input_files/whitespace_deleting_2 +++ /dev/null @@ -1,3 +0,0 @@ -define(a, b) a_ ---- -b diff --git a/tests/input_files/wodl_1 b/tests/input_files/wodl_1 deleted file mode 100644 index 6466022..0000000 --- a/tests/input_files/wodl_1 +++ /dev/null @@ -1,3 +0,0 @@ -wodl(https://google.com) ---- - diff --git a/tests/input_files/wodl_2 b/tests/input_files/wodl_2 deleted file mode 100644 index 51be3e1..0000000 --- a/tests/input_files/wodl_2 +++ /dev/null @@ -1,3 +0,0 @@ -wodl(http://domene_som_ikke_finnes.no) ---- - diff --git a/tests/skaldpress/content/article.md b/tests/skaldpress/content/article.md new file mode 100644 index 0000000..b20468c --- /dev/null +++ b/tests/skaldpress/content/article.md @@ -0,0 +1,11 @@ +--- +title: Example-article +target_filename: example-article +template: article.html +publish_date: 2025-01-01T00:00:00Z +summary: A short example article +tags: + - article +--- + +This is a example article diff --git a/tests/skaldpress/templates/article.html b/tests/skaldpress/templates/article.html new file mode 100644 index 0000000..cb3b58b --- /dev/null +++ b/tests/skaldpress/templates/article.html @@ -0,0 +1,22 @@ +--- +template: base.html +table_of_contents: true +keep_states: + - TOC_ITEMS +--- +DNL include(templates/common_macros.smp)DNL +
+

METADATA_title

+
+ +
+ + + CONTENT +
+ diff --git a/tests/skaldpress/templates/base.html b/tests/skaldpress/templates/base.html new file mode 100644 index 0000000..aa73ffc --- /dev/null +++ b/tests/skaldpress/templates/base.html @@ -0,0 +1,14 @@ + + + + + + CONTENT + + + + + diff --git a/tests/smp/array_each_1 b/tests/smp/array_each_1 new file mode 100644 index 0000000..5844d71 --- /dev/null +++ b/tests/smp/array_each_1 @@ -0,0 +1,7 @@ +define_array(arr)DNL +define(item, $0)DNL +array_push(arr, test)DNL +array_push(arr, tast)DNL +array_each(arr, item) +--- +testtast diff --git a/tests/smp/array_push_1 b/tests/smp/array_push_1 new file mode 100644 index 0000000..fb59320 --- /dev/null +++ b/tests/smp/array_push_1 @@ -0,0 +1,5 @@ +define_array(arr)DNL +array_push(arr, test)DNL +array_size(arr) +--- +1 diff --git a/tests/smp/array_push_2 b/tests/smp/array_push_2 new file mode 100644 index 0000000..3b4d652 --- /dev/null +++ b/tests/smp/array_push_2 @@ -0,0 +1,5 @@ +define_array(arr)DNL +array_push(arr, test, tast, toast)DNL +array_size(arr) +--- +3 diff --git a/tests/smp/array_push_3 b/tests/smp/array_push_3 new file mode 100644 index 0000000..60417b4 --- /dev/null +++ b/tests/smp/array_push_3 @@ -0,0 +1,8 @@ +define_array(arr)DNL +array_push(arr, test, tast, toast)DNL +array_size(arr) +array_push(arr, test, tast, toast)DNL +array_size(arr) +--- +3 +6 diff --git a/tests/smp/define_1 b/tests/smp/define_1 new file mode 100644 index 0000000..68002ea --- /dev/null +++ b/tests/smp/define_1 @@ -0,0 +1,5 @@ +define(TEMP, testvalue) +TEMP +--- + +testvalue diff --git a/tests/smp/define_2 b/tests/smp/define_2 new file mode 100644 index 0000000..016294a --- /dev/null +++ b/tests/smp/define_2 @@ -0,0 +1,3 @@ +define(TEMP, TEMP2)define(TEMP)ifdef(TEMP2, TEMP2_ISDEF) +--- +TEMP2_ISDEF diff --git a/tests/smp/dnl_1 b/tests/smp/dnl_1 new file mode 100644 index 0000000..c12bc01 --- /dev/null +++ b/tests/smp/dnl_1 @@ -0,0 +1,4 @@ +DNL +test +--- +test diff --git a/tests/smp/dnl_2 b/tests/smp/dnl_2 new file mode 100644 index 0000000..356aee9 --- /dev/null +++ b/tests/smp/dnl_2 @@ -0,0 +1,4 @@ +DNL ifdef(a, b, c) +test +--- +test diff --git a/tests/smp/dnl_3 b/tests/smp/dnl_3 new file mode 100644 index 0000000..356aee9 --- /dev/null +++ b/tests/smp/dnl_3 @@ -0,0 +1,4 @@ +DNL ifdef(a, b, c) +test +--- +test diff --git a/tests/smp/dnl_4 b/tests/smp/dnl_4 new file mode 100644 index 0000000..67c1c0e --- /dev/null +++ b/tests/smp/dnl_4 @@ -0,0 +1,4 @@ +DNL +test +--- +test diff --git a/tests/smp/explode_1 b/tests/smp/explode_1 new file mode 100644 index 0000000..79b70ba --- /dev/null +++ b/tests/smp/explode_1 @@ -0,0 +1,5 @@ +define_array(arr)DNL +explode(arr, |, a|b|c|d)DNL +array_size(arr) +--- +4 diff --git a/tests/smp/explode_2 b/tests/smp/explode_2 new file mode 100644 index 0000000..7ef0c08 --- /dev/null +++ b/tests/smp/explode_2 @@ -0,0 +1,6 @@ +define_array(arr)DNL +define(item, $0)DNL +explode(arr, |, a|b|c|d)DNL +array_each(arr, item) +--- +abcd diff --git a/tests/smp/format_time_1 b/tests/smp/format_time_1 new file mode 100644 index 0000000..bd9a097 --- /dev/null +++ b/tests/smp/format_time_1 @@ -0,0 +1,3 @@ +format_time(%d %B %Y, 2024-04-04T00:00:00Z) +--- +04 April 2024 diff --git a/tests/smp/ifdef_1 b/tests/smp/ifdef_1 new file mode 100644 index 0000000..a308141 --- /dev/null +++ b/tests/smp/ifdef_1 @@ -0,0 +1,6 @@ +define(MAC1, test)SNNL +ifdef(MAC1, MAC1_ISDEF) +ifdef(MAC2, MAC2_ISDEF, MAC2_ISNDEF) +--- +MAC1_ISDEF +MAC2_ISNDEF diff --git a/tests/smp/ifdef_2 b/tests/smp/ifdef_2 new file mode 100644 index 0000000..ecef66c --- /dev/null +++ b/tests/smp/ifdef_2 @@ -0,0 +1,3 @@ +ifdef(MAC, MAC_ISDEF) +--- + diff --git a/tests/smp/ifdef_3 b/tests/smp/ifdef_3 new file mode 100644 index 0000000..4867034 --- /dev/null +++ b/tests/smp/ifdef_3 @@ -0,0 +1,3 @@ +ifdef(MAC, MAC_ISDEF, MAC_ISNDEF) +--- +MAC_ISNDEF diff --git a/tests/smp/ifeq_1 b/tests/smp/ifeq_1 new file mode 100644 index 0000000..3e49f68 --- /dev/null +++ b/tests/smp/ifeq_1 @@ -0,0 +1,3 @@ +ifeq(a, a, true, false) +--- +true diff --git a/tests/smp/ifeq_2 b/tests/smp/ifeq_2 new file mode 100644 index 0000000..fe7c0ac --- /dev/null +++ b/tests/smp/ifeq_2 @@ -0,0 +1,3 @@ +ifeq(a, b, true, false) +--- +false diff --git a/tests/smp/ifeq_3 b/tests/smp/ifeq_3 new file mode 100644 index 0000000..42646b8 --- /dev/null +++ b/tests/smp/ifeq_3 @@ -0,0 +1,3 @@ +ifeq(a, a, true) +--- +true diff --git a/tests/smp/ifeq_4 b/tests/smp/ifeq_4 new file mode 100644 index 0000000..d069530 --- /dev/null +++ b/tests/smp/ifeq_4 @@ -0,0 +1,3 @@ +ifeq(a, b, true) +--- + diff --git a/tests/smp/ifndef_1 b/tests/smp/ifndef_1 new file mode 100644 index 0000000..857204b --- /dev/null +++ b/tests/smp/ifndef_1 @@ -0,0 +1,3 @@ +ifndef(MAC, MAC_ISNDEF) +--- +MAC_ISNDEF diff --git a/tests/smp/ifndef_2 b/tests/smp/ifndef_2 new file mode 100644 index 0000000..fbe0ba3 --- /dev/null +++ b/tests/smp/ifndef_2 @@ -0,0 +1,4 @@ +define(MAC, test)SNNL +ifndef(MAC, MAC_ISNDEF, MAC_ISDEF) +--- +MAC_ISDEF diff --git a/tests/smp/ifndef_3 b/tests/smp/ifndef_3 new file mode 100644 index 0000000..82a180d --- /dev/null +++ b/tests/smp/ifndef_3 @@ -0,0 +1,4 @@ +define(MAC, test)SNNL +ifndef(MAC, MAC_ISNDEF) +--- + diff --git a/tests/smp/ifneq_1 b/tests/smp/ifneq_1 new file mode 100644 index 0000000..5b443c5 --- /dev/null +++ b/tests/smp/ifneq_1 @@ -0,0 +1,3 @@ +ifneq(a, a, true, false) +--- +false diff --git a/tests/smp/ifneq_2 b/tests/smp/ifneq_2 new file mode 100644 index 0000000..8145e9f --- /dev/null +++ b/tests/smp/ifneq_2 @@ -0,0 +1,3 @@ +ifneq(a, b, true, false) +--- +true diff --git a/tests/smp/ifneq_3 b/tests/smp/ifneq_3 new file mode 100644 index 0000000..163d871 --- /dev/null +++ b/tests/smp/ifneq_3 @@ -0,0 +1,3 @@ +ifneq(a, a, true) +--- + diff --git a/tests/smp/ifneq_4 b/tests/smp/ifneq_4 new file mode 100644 index 0000000..c93a572 --- /dev/null +++ b/tests/smp/ifneq_4 @@ -0,0 +1,3 @@ +ifneq(a, b, true) +--- +true diff --git a/tests/smp/include_1 b/tests/smp/include_1 new file mode 100644 index 0000000..1621de2 --- /dev/null +++ b/tests/smp/include_1 @@ -0,0 +1,3 @@ +include(tests/example_include.smp) +--- + diff --git a/tests/smp/include_2 b/tests/smp/include_2 new file mode 100644 index 0000000..2714eff --- /dev/null +++ b/tests/smp/include_2 @@ -0,0 +1,4 @@ +include(tests/example_include.smp)SNNL +ifdef(SMP, SMP_ISDEF, SMP_ISNDEF) +--- +SMP_ISDEF diff --git a/tests/smp/markdown_html_1 b/tests/smp/markdown_html_1 new file mode 100644 index 0000000..6a9f143 --- /dev/null +++ b/tests/smp/markdown_html_1 @@ -0,0 +1,5 @@ +html_from_markdown(%" +# Test +"%) +--- +

Test

diff --git a/tests/smp/markdown_html_2 b/tests/smp/markdown_html_2 new file mode 100644 index 0000000..6a9f143 --- /dev/null +++ b/tests/smp/markdown_html_2 @@ -0,0 +1,5 @@ +html_from_markdown(%" +# Test +"%) +--- +

Test

diff --git a/tests/smp/non_macro_html b/tests/smp/non_macro_html new file mode 100644 index 0000000..6f49b4a --- /dev/null +++ b/tests/smp/non_macro_html @@ -0,0 +1,7 @@ + +

This is a test

+ +--- + +

This is a test

+ diff --git a/tests/smp/shell_1 b/tests/smp/shell_1 new file mode 100644 index 0000000..3eb1f14 --- /dev/null +++ b/tests/smp/shell_1 @@ -0,0 +1,3 @@ +shell(printf test) +--- +test diff --git a/tests/smp/snnl_1 b/tests/smp/snnl_1 new file mode 100644 index 0000000..47a10b9 --- /dev/null +++ b/tests/smp/snnl_1 @@ -0,0 +1,4 @@ +SNNL +test +--- +test diff --git a/tests/smp/snnl_2 b/tests/smp/snnl_2 new file mode 100644 index 0000000..2fcd0ba --- /dev/null +++ b/tests/smp/snnl_2 @@ -0,0 +1,4 @@ +SNNL +test +--- +test diff --git a/tests/smp/snnl_3 b/tests/smp/snnl_3 new file mode 100644 index 0000000..4a7dad7 --- /dev/null +++ b/tests/smp/snnl_3 @@ -0,0 +1,5 @@ +define(MAC1, test)SNNL +MAC1 SNNL +test +--- +test test diff --git a/tests/smp/whitespace_deleting_1 b/tests/smp/whitespace_deleting_1 new file mode 100644 index 0000000..ccda45f --- /dev/null +++ b/tests/smp/whitespace_deleting_1 @@ -0,0 +1,3 @@ +define(a, b) a +--- + b diff --git a/tests/smp/whitespace_deleting_2 b/tests/smp/whitespace_deleting_2 new file mode 100644 index 0000000..8777c39 --- /dev/null +++ b/tests/smp/whitespace_deleting_2 @@ -0,0 +1,3 @@ +define(a, b) a_ +--- +b diff --git a/tests/smp/wodl_1 b/tests/smp/wodl_1 new file mode 100644 index 0000000..6466022 --- /dev/null +++ b/tests/smp/wodl_1 @@ -0,0 +1,3 @@ +wodl(https://google.com) +--- + diff --git a/tests/smp/wodl_2 b/tests/smp/wodl_2 new file mode 100644 index 0000000..51be3e1 --- /dev/null +++ b/tests/smp/wodl_2 @@ -0,0 +1,3 @@ +wodl(http://domene_som_ikke_finnes.no) +--- + diff --git a/tests/test_macro_processor.sh b/tests/test_macro_processor.sh index 1a7accd..daee5d2 100755 --- a/tests/test_macro_processor.sh +++ b/tests/test_macro_processor.sh @@ -3,7 +3,7 @@ ALL_OUTPUT=0 test () { - file_content=$(