diff options
Diffstat (limited to 'python/tidy/servo_tidy_tests')
-rw-r--r-- | python/tidy/servo_tidy_tests/shell_tidy.sh | 4 | ||||
-rw-r--r-- | python/tidy/servo_tidy_tests/test_tidy.py | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/shell_tidy.sh b/python/tidy/servo_tidy_tests/shell_tidy.sh index e24b361fe16..e38358fc3b6 100644 --- a/python/tidy/servo_tidy_tests/shell_tidy.sh +++ b/python/tidy/servo_tidy_tests/shell_tidy.sh @@ -8,3 +8,7 @@ set -o nounset echo "hello world" some_var=`echo "command substitution"` another_var="$some_var" +if [ -z "${some_var}" ]; then + echo "should have used [[" +fi +[ -z "${another_var}" ] diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py index 2eee04a19a3..92b304a5c1a 100644 --- a/python/tidy/servo_tidy_tests/test_tidy.py +++ b/python/tidy/servo_tidy_tests/test_tidy.py @@ -54,6 +54,8 @@ class CheckTidiness(unittest.TestCase): self.assertEqual('script is missing options "set -o errexit", "set -o pipefail"', errors.next()[2]) self.assertEqual('script should not use backticks for command substitution', errors.next()[2]) self.assertEqual('variable substitutions should use the full \"${VAR}\" form', errors.next()[2]) + self.assertEqual('script should use `[[` instead of `[` for conditional testing', errors.next()[2]) + self.assertEqual('script should use `[[` instead of `[` for conditional testing', errors.next()[2]) self.assertNoMoreErrors(errors) def test_rust(self): |