aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-08-19 03:10:15 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-08-19 03:29:11 +0200
commit8d0d30d949b2dbd3ce762458e1c6676487e4da26 (patch)
tree6f029a110123caf01c5dd444e12685d02357ce4f
parent61ff6e97c57f62ee3ad4ffc2166e433bc060e7cb (diff)
downloadsciteco-8d0d30d949b2dbd3ce762458e1c6676487e4da26.tar.gz
added test group for SciTECO's EOL normalisation feature
-rw-r--r--tests/.gitattributes3
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/autoeol-input.txt4
-rw-r--r--tests/autoeol-output.txt4
-rw-r--r--tests/testsuite.at7
5 files changed, 21 insertions, 0 deletions
diff --git a/tests/.gitattributes b/tests/.gitattributes
new file mode 100644
index 0000000..47fa95e
--- /dev/null
+++ b/tests/.gitattributes
@@ -0,0 +1,3 @@
+# These files are used to check SciTECO's EOL normalization,
+# so we enforce that they are not normalized by Git:
+autoeol-*.txt -text
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2fe3a53..997a473 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,6 +19,9 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) atlocal.in
TESTSUITE = $(srcdir)/testsuite
+# Files used by test groups in testsuite.at:
+EXTRA_DIST += autoeol-input.txt autoeol-output.txt
+
check-local: atconfig atlocal $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
diff --git a/tests/autoeol-input.txt b/tests/autoeol-input.txt
new file mode 100644
index 0000000..237e7d1
--- /dev/null
+++ b/tests/autoeol-input.txt
@@ -0,0 +1,4 @@
+Hello
+world
+FOO
+BAR \ No newline at end of file
diff --git a/tests/autoeol-output.txt b/tests/autoeol-output.txt
new file mode 100644
index 0000000..5fb4c8e
--- /dev/null
+++ b/tests/autoeol-output.txt
@@ -0,0 +1,4 @@
+Hello
+world
+FOO
+BAR
diff --git a/tests/testsuite.at b/tests/testsuite.at
index b43f874..81a770c 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -1,5 +1,12 @@
AT_INIT
+AT_COLOR_TESTS
AT_SETUP([Closing loops at the correct macro level])
AT_CHECK([$SCITECO -e '@^Ua{>} <Ma'], 1, ignore, ignore)
AT_CLEANUP
+
+AT_SETUP([Automatic EOL normalization])
+AT_CHECK([$SCITECO -e "@EB'${srcdir}/autoeol-input.txt' EL-2\"N/0' 2LR 13@I'' 0EL @EW'autoeol-sciteco.txt'"],
+ 0, ignore, ignore)
+AT_CHECK([cmp -b autoeol-sciteco.txt ${srcdir}/autoeol-output.txt], 0, ignore, ignore)
+AT_CLEANUP