Skip to content

Commit a863dba

Browse files
committed
Backport the additional const tests.
1 parent 2e0e86e commit a863dba

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

tests/draft6/const.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
]
127127
},
128128
{
129-
"description": "const with 0 does not match false",
129+
"description": "const with 0 does not match other zero-like types",
130130
"schema": {"const": 0},
131131
"tests": [
132132
{
@@ -143,6 +143,21 @@
143143
"description": "float zero is valid",
144144
"data": 0.0,
145145
"valid": true
146+
},
147+
{
148+
"description": "empty object is invalid",
149+
"data": {},
150+
"valid": false
151+
},
152+
{
153+
"description": "empty array is invalid",
154+
"data": [],
155+
"valid": false
156+
},
157+
{
158+
"description": "empty string is invalid",
159+
"data": "",
160+
"valid": false
146161
}
147162
]
148163
},

tests/draft7/const.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
]
127127
},
128128
{
129-
"description": "const with 0 does not match false",
129+
"description": "const with 0 does not match other zero-like types",
130130
"schema": {"const": 0},
131131
"tests": [
132132
{
@@ -143,6 +143,21 @@
143143
"description": "float zero is valid",
144144
"data": 0.0,
145145
"valid": true
146+
},
147+
{
148+
"description": "empty object is invalid",
149+
"data": {},
150+
"valid": false
151+
},
152+
{
153+
"description": "empty array is invalid",
154+
"data": [],
155+
"valid": false
156+
},
157+
{
158+
"description": "empty string is invalid",
159+
"data": "",
160+
"valid": false
146161
}
147162
]
148163
},

0 commit comments

Comments
 (0)