From aba95d2f8cd0b945a7cf774f8c628a000f601810 Mon Sep 17 00:00:00 2001 From: pommicket Date: Mon, 8 Sep 2025 19:48:21 -0400 Subject: Add whitespace test --- pre-commit.sh | 5 ++--- tests/parsing/whitespace.flat.pom | 9 +++++++++ tests/parsing/whitespace.pom | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 tests/parsing/whitespace.flat.pom create mode 100644 tests/parsing/whitespace.pom diff --git a/pre-commit.sh b/pre-commit.sh index 995cc0a..5930194 100755 --- a/pre-commit.sh +++ b/pre-commit.sh @@ -1,8 +1,7 @@ #!/bin/bash +# Check with Nu validator (https://github.com/validator/validator) if installed +which vnu >/dev/null && vnu site/*.html || exit 1 for file in site/*.html; do - echo "Checking $file..." - # Check with Nu validator (https://github.com/validator/validator) if installed - which vnu >/dev/null && vnu $file || exit 1 # /dev/null is to force file names to be printed (grep -H is a GNU extension) if grep -n '\s$' /dev/null $file; then echo "$file has trailing white space." diff --git a/tests/parsing/whitespace.flat.pom b/tests/parsing/whitespace.flat.pom new file mode 100644 index 0000000..84fa535 --- /dev/null +++ b/tests/parsing/whitespace.flat.pom @@ -0,0 +1,9 @@ +foo1 = "bar1" +foo2 = "bar2" +foo3 = "bar3" +sect.foo4 = "bar4" +sect2.foo = "7" +hasspc = "\t space\t " +hasspc2 = " \tspace \t" +nbsp = "\u{a0}n\u{a0}" +zwsp = "\u{200b}z\u{200b}" diff --git a/tests/parsing/whitespace.pom b/tests/parsing/whitespace.pom new file mode 100644 index 0000000..6598fa1 --- /dev/null +++ b/tests/parsing/whitespace.pom @@ -0,0 +1,14 @@ + +#^ byte order marker +foo1=bar1 +foo2 = bar2 + foo3 = bar3 + [sect] + foo4 = bar4 +[sect2] + foo=7 +[] +hasspc=" space " +hasspc2=` space ` +nbsp=  n  +zwsp=​z​ -- cgit v1.2.3