[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: preconv: Tweak tests.
From: |
G. Branden Robinson |
Subject: |
[groff] 01/01: preconv: Tweak tests. |
Date: |
Fri, 15 May 2020 03:18:07 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 3ba6fa3799d136e386e1909d6ef6132640a634aa
Author: G. Branden Robinson <address@hidden>
AuthorDate: Thu May 14 22:55:29 2020 +1000
preconv: Tweak tests.
* src/preproc/preconv/tests/smoke-test.sh: Make BOM detection override
less hinky (i.e., use more normative input). Add tests for all five
detected BOMs.
---
ChangeLog | 6 ++++++
src/preproc/preconv/tests/smoke-test.sh | 26 +++++++++++++++++++++++---
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c5f8a55..7f3c0ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-14 G. Branden Robinson <address@hidden>
+
+ * src/preproc/preconv/tests/smoke-test.sh: Make BOM detection
+ override less hinky (i.e., use more normative input). Add tests
+ for all five detected BOMs.
+
2020-05-09 G. Branden Robinson <address@hidden>
* src/roff/troff/env.cpp (space_size): If an argument to the .ss
diff --git a/src/preproc/preconv/tests/smoke-test.sh
b/src/preproc/preconv/tests/smoke-test.sh
index bd9343f..4131416 100755
--- a/src/preproc/preconv/tests/smoke-test.sh
+++ b/src/preproc/preconv/tests/smoke-test.sh
@@ -26,12 +26,32 @@ set -e
preconv="${abs_top_builddir:-.}/preconv"
echo "testing -e flag override of BOM detection" >&2
-printf '\376\377foobar\n' \
+printf '\376\377\0\100\0\n' \
| "$preconv" -d -e euc-kr 2>&1 > /dev/null \
| grep -q "no search for coding tag"
-echo "testing detection of (big-endian) BOM" >&2
-printf '\376\377foobar\n' \
+echo "testing detection of UTF-32BE BOM" >&2
+printf '\0\0\376\377\0\0\0\100\0\0\0\n' \
+ | "$preconv" -d 2>&1 > /dev/null \
+ | grep -q "found BOM"
+
+echo "testing detection of UTF-32LE BOM" >&2
+printf '\377\376\0\0\100\0\0\0\n\0\0\0' \
+ | "$preconv" -d 2>&1 > /dev/null \
+ | grep -q "found BOM"
+
+echo "testing detection of UTF-16BE BOM" >&2
+printf '\376\377\0\100\0\n' \
+ | "$preconv" -d 2>&1 > /dev/null \
+ | grep -q "found BOM"
+
+echo "testing detection of UTF-16LE BOM" >&2
+printf '\377\376\100\0\n\0' \
+ | "$preconv" -d 2>&1 > /dev/null \
+ | grep -q "found BOM"
+
+echo "testing detection of UTF-8 BOM" >&2
+printf '\357\273\277@\n' \
| "$preconv" -d 2>&1 > /dev/null \
| grep -q "found BOM"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: preconv: Tweak tests.,
G. Branden Robinson <=