summaryrefslogtreecommitdiff
path: root/tests/files/fail/test_type_bool.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/files/fail/test_type_bool.yaml')
-rw-r--r--tests/files/fail/test_type_bool.yaml52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/files/fail/test_type_bool.yaml b/tests/files/fail/test_type_bool.yaml
new file mode 100644
index 0000000..1007348
--- /dev/null
+++ b/tests/files/fail/test_type_bool.yaml
@@ -0,0 +1,52 @@
+---
+name: fail-type-bool-1
+desc: Test wrong type as value in list
+data:
+ - "foo"
+schema:
+ type: seq
+ matching: "any"
+ seq:
+ - type: bool
+errors:
+ - "Value 'foo' is not of type 'bool'. Path: '/0'"
+---
+name: fail-type-bool-2
+desc: Test bool value inside list
+data:
+ - 'abc'
+ - 123
+schema:
+ type: seq
+ sequence:
+ - type: bool
+errors:
+ - "Value '123' is not of type 'bool'. Path: '/1'"
+ - "Value 'abc' is not of type 'bool'. Path: '/0'"
+---
+name: fail-type-bool-3
+desc: Test bool value in mapping
+data:
+ foo: 'abc'
+schema:
+ type: map
+ mapping:
+ foo:
+ type: bool
+errors:
+ - "Value 'abc' is not of type 'bool'. Path: '/foo'"
+---
+name: fail-type-bool-4
+desc: Test bool inside nested map & seq
+data:
+ foo:
+ - 'abc'
+schema:
+ type: map
+ mapping:
+ foo:
+ type: seq
+ sequence:
+ - type: bool
+errors:
+ - "Value 'abc' is not of type 'bool'. Path: '/foo/0'"