]> git.scottworley.com Git - pinch/commitdiff
Verify unknown config fields raise errors
authorScott Worley <scottworley@scottworley.com>
Wed, 17 Jun 2020 21:03:43 +0000 (14:03 -0700)
committerScott Worley <scottworley@scottworley.com>
Thu, 18 Jun 2020 06:15:29 +0000 (23:15 -0700)
tests/reject-unknown-field.sh [new file with mode: 0755]

diff --git a/tests/reject-unknown-field.sh b/tests/reject-unknown-field.sh
new file mode 100755 (executable)
index 0000000..dfe069c
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+. ./tests/lib/test-setup.sh
+
+foo_setup
+
+echo "whatisthis = I don't even" >> "$conf"
+
+if python3 ./pinch.py pin "$conf";then
+  echo "FAIL: Config with unknown field should be rejected"
+  exit 1
+else
+  echo PASS
+fi