summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2018-06-02 14:04:58 -0400
committerJulian Berman <Julian@GrayVines.com>2018-06-02 14:04:58 -0400
commitc268d99b5f358196ad6f848c2f48581753f88803 (patch)
treef7a3aba352096430c9f6bc1190a725fbc403776d /tests
parent86baa128d16324ed62a2cc5cdf5db276d8e0d734 (diff)
downloadjsonschema-c268d99b5f358196ad6f848c2f48581753f88803.tar.gz
Squashed 'json/' changes from 2ca50c0..e64ebf9
e64ebf9 Merge pull request #226 from hrzndhrn/add/date-stirng-tests f25195c Remove test unrelated to this PR 113497d Put tests in the right file 03480d4 Fix test with negative offset eadbf69 Add tests for date-strings 4336571 Merge pull request #224 from santhosh-tekuri/content_nonstrings 1507e57 content: ignore non-strings git-subtree-dir: json git-subtree-split: e64ebf90a001f4e0e18984d2086ea15765cfead2
Diffstat (limited to 'tests')
-rw-r--r--tests/draft4/optional/format.json25
-rw-r--r--tests/draft6/optional/format.json25
-rw-r--r--tests/draft7/optional/content.json15
-rw-r--r--tests/draft7/optional/format/date-time.json25
4 files changed, 90 insertions, 0 deletions
diff --git a/tests/draft4/optional/format.json b/tests/draft4/optional/format.json
index 15c3652..4bf4ea8 100644
--- a/tests/draft4/optional/format.json
+++ b/tests/draft4/optional/format.json
@@ -9,6 +9,31 @@
"valid": true
},
{
+ "description": "a valid date-time string without second fraction",
+ "data": "1963-06-19T08:30:06Z",
+ "valid": true
+ },
+ {
+ "description": "a valid date-time string with plus offset",
+ "data": "1937-01-01T12:00:27.87+00:20",
+ "valid": true
+ },
+ {
+ "description": "a valid date-time string with minus offset",
+ "data": "1990-12-31T15:59:50.123-08:00",
+ "valid": true
+ },
+ {
+ "description": "a invalid day in date-time string",
+ "data": "1990-02-31T15:59:60.123-08:00",
+ "valid": false
+ },
+ {
+ "description": "an invalid offset in date-time string",
+ "data": "1990-12-31T15:59:60-24:00",
+ "valid": false
+ },
+ {
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"valid": false
diff --git a/tests/draft6/optional/format.json b/tests/draft6/optional/format.json
index d192ff0..8837485 100644
--- a/tests/draft6/optional/format.json
+++ b/tests/draft6/optional/format.json
@@ -9,6 +9,31 @@
"valid": true
},
{
+ "description": "a valid date-time string without second fraction",
+ "data": "1963-06-19T08:30:06Z",
+ "valid": true
+ },
+ {
+ "description": "a valid date-time string with plus offset",
+ "data": "1937-01-01T12:00:27.87+00:20",
+ "valid": true
+ },
+ {
+ "description": "a valid date-time string with minus offset",
+ "data": "1990-12-31T15:59:50.123-08:00",
+ "valid": true
+ },
+ {
+ "description": "a invalid day in date-time string",
+ "data": "1990-02-31T15:59:60.123-08:00",
+ "valid": false
+ },
+ {
+ "description": "an invalid offset in date-time string",
+ "data": "1990-12-31T15:59:60-24:00",
+ "valid": false
+ },
+ {
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"valid": false
diff --git a/tests/draft7/optional/content.json b/tests/draft7/optional/content.json
index 6a98f11..3f5a743 100644
--- a/tests/draft7/optional/content.json
+++ b/tests/draft7/optional/content.json
@@ -14,6 +14,11 @@
"description": "an invalid JSON document",
"data": "{:}",
"valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 100,
+ "valid": true
}
]
},
@@ -32,6 +37,11 @@
"description": "an invalid base64 string (% is not a valid character)",
"data": "eyJmb28iOi%iYmFyIn0K",
"valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 100,
+ "valid": true
}
]
},
@@ -56,6 +66,11 @@
"description": "an invalid base64 string that is valid JSON",
"data": "{}",
"valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 100,
+ "valid": true
}
]
}
diff --git a/tests/draft7/optional/format/date-time.json b/tests/draft7/optional/format/date-time.json
index 90279ba..dfccee6 100644
--- a/tests/draft7/optional/format/date-time.json
+++ b/tests/draft7/optional/format/date-time.json
@@ -9,6 +9,31 @@
"valid": true
},
{
+ "description": "a valid date-time string without second fraction",
+ "data": "1963-06-19T08:30:06Z",
+ "valid": true
+ },
+ {
+ "description": "a valid date-time string with plus offset",
+ "data": "1937-01-01T12:00:27.87+00:20",
+ "valid": true
+ },
+ {
+ "description": "a valid date-time string with minus offset",
+ "data": "1990-12-31T15:59:50.123-08:00",
+ "valid": true
+ },
+ {
+ "description": "a invalid day in date-time string",
+ "data": "1990-02-31T15:59:60.123-08:00",
+ "valid": false
+ },
+ {
+ "description": "an invalid offset in date-time string",
+ "data": "1990-12-31T15:59:60-24:00",
+ "valid": false
+ },
+ {
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"valid": false