JAL-1641 biojson documentation with docson
[jalview.git] / examples / biojson-doc / tests / pattern.json
diff --git a/examples/biojson-doc/tests/pattern.json b/examples/biojson-doc/tests/pattern.json
new file mode 100755 (executable)
index 0000000..befc4b5
--- /dev/null
@@ -0,0 +1,23 @@
+[
+    {
+        "description": "pattern validation",
+        "schema": {"pattern": "^a*$"},
+        "tests": [
+            {
+                "description": "a matching pattern is valid",
+                "data": "aaa",
+                "valid": true
+            },
+            {
+                "description": "a non-matching pattern is invalid",
+                "data": "abc",
+                "valid": false
+            },
+            {
+                "description": "ignores non-strings",
+                "data": true,
+                "valid": true
+            }
+        ]
+    }
+]