Skip to content

Commit

Permalink
test a malformed pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
karenetheridge committed Jun 3, 2020
1 parent c3f4319 commit 00570e4
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/draft2019-09/pattern.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,27 @@
"description": "pattern is not anchored",
"schema": {"pattern": "a+"},
"tests": [
{
"description": "doesn't match a substring",
"data": "xxyy",
"valid": false
},
{
"description": "matches a substring",
"data": "xxaayy",
"valid": true
}
]
},
{
"description": "pattern is malformed",
"schema": {"pattern": "hel{1,"},
"tests": [
{
"description": "invalid regex does not match",
"data": "hello",
"valid": false
}
]
}
]
16 changes: 16 additions & 0 deletions tests/draft3/pattern.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,27 @@
"description": "pattern is not anchored",
"schema": {"pattern": "a+"},
"tests": [
{
"description": "doesn't match a substring",
"data": "xxyy",
"valid": false
},
{
"description": "matches a substring",
"data": "xxaayy",
"valid": true
}
]
},
{
"description": "pattern is malformed",
"schema": {"pattern": "hel{1,"},
"tests": [
{
"description": "invalid regex does not match",
"data": "hello",
"valid": false
}
]
}
]
16 changes: 16 additions & 0 deletions tests/draft4/pattern.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,27 @@
"description": "pattern is not anchored",
"schema": {"pattern": "a+"},
"tests": [
{
"description": "doesn't match a substring",
"data": "xxyy",
"valid": false
},
{
"description": "matches a substring",
"data": "xxaayy",
"valid": true
}
]
},
{
"description": "pattern is malformed",
"schema": {"pattern": "hel{1,"},
"tests": [
{
"description": "invalid regex does not match",
"data": "hello",
"valid": false
}
]
}
]
16 changes: 16 additions & 0 deletions tests/draft6/pattern.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,27 @@
"description": "pattern is not anchored",
"schema": {"pattern": "a+"},
"tests": [
{
"description": "doesn't match a substring",
"data": "xxyy",
"valid": false
},
{
"description": "matches a substring",
"data": "xxaayy",
"valid": true
}
]
},
{
"description": "pattern is malformed",
"schema": {"pattern": "hel{1,"},
"tests": [
{
"description": "invalid regex does not match",
"data": "hello",
"valid": false
}
]
}
]
16 changes: 16 additions & 0 deletions tests/draft7/pattern.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,27 @@
"description": "pattern is not anchored",
"schema": {"pattern": "a+"},
"tests": [
{
"description": "doesn't match a substring",
"data": "xxyy",
"valid": false
},
{
"description": "matches a substring",
"data": "xxaayy",
"valid": true
}
]
},
{
"description": "pattern is malformed",
"schema": {"pattern": "hel{1,"},
"tests": [
{
"description": "invalid regex does not match",
"data": "hello",
"valid": false
}
]
}
]

0 comments on commit 00570e4

Please sign in to comment.