summaryrefslogtreecommitdiffstats
path: root/contrib/libucl/tests/schema/maxLength.json
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libucl/tests/schema/maxLength.json')
-rw-r--r--contrib/libucl/tests/schema/maxLength.json28
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/libucl/tests/schema/maxLength.json b/contrib/libucl/tests/schema/maxLength.json
new file mode 100644
index 0000000..561767b
--- /dev/null
+++ b/contrib/libucl/tests/schema/maxLength.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxLength validation",
+ "schema": {"maxLength": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": "f",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 10,
+ "valid": true
+ }
+ ]
+ }
+]
OpenPOWER on IntegriCloud