From 5e56ea491ecd7ba8ac08e2b3e95e2a5b86520be0 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Fri, 18 Jan 2019 17:52:44 +0000 Subject: [PATCH] Add test scripts --- macros | 5 +++++ test.sh | 4 ++++ tests/macros | 5 +++++ tests/test_actual_output | 12 ++++++++++++ tests/test_expected_output | 12 ++++++++++++ tests/test_input | 12 ++++++++++++ tests/test_macros_biology | 2 ++ tests/test_macros_custom_plurals | 1 + tests/test_macros_plural | 6 ++++++ 9 files changed, 59 insertions(+) create mode 100644 macros create mode 100755 test.sh create mode 100644 tests/macros create mode 100644 tests/test_actual_output create mode 100644 tests/test_expected_output create mode 100644 tests/test_input create mode 100644 tests/test_macros_biology create mode 100644 tests/test_macros_custom_plurals create mode 100644 tests/test_macros_plural diff --git a/macros b/macros new file mode 100644 index 0000000..9b87ce8 --- /dev/null +++ b/macros @@ -0,0 +1,5 @@ +.hc hydrocarbon +.h hydrogen +.c carbon +.o oxygen +:wink: 😉 diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..e0f60b4 --- /dev/null +++ b/test.sh @@ -0,0 +1,4 @@ +#/usr/bin/env sh +./pymacro -sm tests/test_macros_plural -m tests/test_macros_biology tests/test_input tests/test_actual_output +diff tests/test_actual_output tests/test_expected_output + diff --git a/tests/macros b/tests/macros new file mode 100644 index 0000000..9b87ce8 --- /dev/null +++ b/tests/macros @@ -0,0 +1,5 @@ +.hc hydrocarbon +.h hydrogen +.c carbon +.o oxygen +:wink: 😉 diff --git a/tests/test_actual_output b/tests/test_actual_output new file mode 100644 index 0000000..00f1abf --- /dev/null +++ b/tests/test_actual_output @@ -0,0 +1,12 @@ +Hydrocarbons are composed of exclusively hydrogen and carbon. + +Chlorophyll is the site of photosynthesis. + +😉 + +1 hydrocarbon 2 hydrocarbons +1 dress 2 dresses +1 story 2 stories +1 hero 2 heroes +1 leaf 2 leaves +1 man 2 men diff --git a/tests/test_expected_output b/tests/test_expected_output new file mode 100644 index 0000000..00f1abf --- /dev/null +++ b/tests/test_expected_output @@ -0,0 +1,12 @@ +Hydrocarbons are composed of exclusively hydrogen and carbon. + +Chlorophyll is the site of photosynthesis. + +😉 + +1 hydrocarbon 2 hydrocarbons +1 dress 2 dresses +1 story 2 stories +1 hero 2 heroes +1 leaf 2 leaves +1 man 2 men diff --git a/tests/test_input b/tests/test_input new file mode 100644 index 0000000..8868ec3 --- /dev/null +++ b/tests/test_input @@ -0,0 +1,12 @@ +.Hcs are composed of exclusively .h and .c. + +.Chl is the site of .ps. + +:wink: + +1 .hc 2 .hcs +1 .d 2 .ds +1 .s 2 .ss +1 .he 2 .hes +1 .l 2 .ls +1 .m 2 .ms diff --git a/tests/test_macros_biology b/tests/test_macros_biology new file mode 100644 index 0000000..3d40842 --- /dev/null +++ b/tests/test_macros_biology @@ -0,0 +1,2 @@ +.chl chlorophyll +.ps photosynthesis diff --git a/tests/test_macros_custom_plurals b/tests/test_macros_custom_plurals new file mode 100644 index 0000000..01e66e6 --- /dev/null +++ b/tests/test_macros_custom_plurals @@ -0,0 +1 @@ +.l louse lice diff --git a/tests/test_macros_plural b/tests/test_macros_plural new file mode 100644 index 0000000..3e4e5fd --- /dev/null +++ b/tests/test_macros_plural @@ -0,0 +1,6 @@ +.hc hydrocarbon +.d dress +.s story +.he hero +.l leaf +.m man men