commit df15f30a4f0f70756b5fb4dde9b188087105e973
parent 4d2bba71bfcc746fc1adabcf7d0cc08d54652817
Author: lumidify <nobody@lumidify.org>
Date: Thu, 26 Mar 2020 10:54:14 +0100
Add another test
Diffstat:
7 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/tests/README b/tests/README
@@ -0,0 +1,4 @@
+Run ./alltests.sh for all tests.
+
+There aren't very many tests here yet. Maybe I'll have
+time someday to test all the edge cases properly.
diff --git a/tests/alltests.sh b/tests/alltests.sh
@@ -2,3 +2,4 @@
./runtest.sh test1
./runtest.sh test2
+./runtest.sh test3
diff --git a/tests/test3/config b/tests/test3/config
@@ -0,0 +1,18 @@
+split "[ \n]+"
+beforeword " "
+afterword "[ \n]"
+tablesep ","
+choicesep "|"
+
+ignore "../data/ignore.txt"
+table words "../data/words1.txt"
+table endings "../data/endings_choices.txt"
+
+expand words other_name endings noroot
+
+match "w ord" "word" beginword nofinal
+matchignore "-d" endword
+
+group beginword endword
+replace other_name
+endgroup
diff --git a/tests/test3/descr.txt b/tests/test3/descr.txt
@@ -0,0 +1 @@
+matchignore only endword; expand noroot
diff --git a/tests/test3/err.txt b/tests/test3/err.txt
@@ -0,0 +1,3 @@
+Unknown word: "word0"
+Word "word1_replacedend1r1|word1_replacedend1r2" with 2 word choices.
+Unknown word: "-dword9end2"
diff --git a/tests/test3/expected.txt b/tests/test3/expected.txt
@@ -0,0 +1,3 @@
+ignore
+word0 word1_replacedend1r1|word1_replacedend1r2
+-dword9end2 word9_replacedend2r-d
diff --git a/tests/test3/input.txt b/tests/test3/input.txt
@@ -0,0 +1,3 @@
+ignore
+word0 word1end1
+-dword9end2 word9end2-d