From 424e1d9622c557d7b94b55a31e9f91938b69d5e4 Mon Sep 17 00:00:00 2001 From: Nate <37554478+servusdei2018@users.noreply.github.com> Date: Sun, 8 Aug 2021 15:10:58 -0400 Subject: tests(tests/unicode_lint.sh): expand unicode lint to the ./tests/ directory --- tests/unicode_lint.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/unicode_lint.sh b/tests/unicode_lint.sh index 969fcc5..dc9f2c0 100644 --- a/tests/unicode_lint.sh +++ b/tests/unicode_lint.sh @@ -1,6 +1,6 @@ #!/bin/bash -# `unicode_lint.sh' determines whether source files under the ./lib/ and ./programs/ directories +# `unicode_lint.sh' determines whether source files under the ./lib/, ./tests/ and ./programs/ directories # contain Unicode characters, and fails if any do. # # See https://github.com/lz4/lz4/issues/1018 @@ -16,6 +16,15 @@ if [[ $result ]]; then pass=false fi +# Scan ./tests/ for Unicode in source (*.c, *.h) files +result=$( + find ./tests/ -regex '.*\.\(c\|h\)$' -exec grep -P -n "[^\x00-\x7F]" {} \; -exec echo "{}: FAIL" \; +) +if [[ $result ]]; then + echo "$result" + pass=false +fi + # Scan ./programs/ for Unicode in source (*.c, *.h) files result=$( find ./programs/ -regex '.*\.\(c\|h\)$' -exec grep -P -n "[^\x00-\x7F]" {} \; -exec echo "{}: FAIL" \; -- cgit v0.12