diff options
author | pommicket <pommicket@gmail.com> | 2025-09-08 19:48:21 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-08 19:48:21 -0400 |
commit | aba95d2f8cd0b945a7cf774f8c628a000f601810 (patch) | |
tree | 66d18b5dfb473833ab8c01d83f11b5ec42b50a7e | |
parent | 99ab15be006b736522017b2c16a206e6540cc57d (diff) |
Add whitespace test
-rwxr-xr-x | pre-commit.sh | 5 | ||||
-rw-r--r-- | tests/parsing/whitespace.flat.pom | 9 | ||||
-rw-r--r-- | tests/parsing/whitespace.pom | 14 |
3 files changed, 25 insertions, 3 deletions
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 |