diff --git a/schemas/w3c/xmlschema/2001/byte.json b/schemas/w3c/xmlschema/2001/byte.json new file mode 100644 index 0000000..078eae5 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/byte.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema byte", + "description": "Represents 8-bit signed integers (§3.3.19)", + "examples": [ 0, 1, -1, 127, -128, 42, -99 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#byte" ], + "$ref": "../../../iso/c/2024/int8.json" +} diff --git a/schemas/w3c/xmlschema/2001/decimal.json b/schemas/w3c/xmlschema/2001/decimal.json index 024cc0e..699906e 100644 --- a/schemas/w3c/xmlschema/2001/decimal.json +++ b/schemas/w3c/xmlschema/2001/decimal.json @@ -2,6 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "W3C XML Schema decimal", "description": "The decimal datatype represents arbitrary precision decimal numbers (§3.2.3)", + "$comment": "XML Schema requires minimally conforming processors to support decimal numbers with a minimum of 18 decimal digits (totalDigits). JSON's number type (IEEE 754 double-precision) provides only 15-17 significant decimal digits, which does not meet this minimum requirement. This schema uses string representation to maintain XML Schema conformance", "examples": [ "-1.23", "12678967.543233", diff --git a/schemas/w3c/xmlschema/2001/int.json b/schemas/w3c/xmlschema/2001/int.json new file mode 100644 index 0000000..3f09ca3 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/int.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema int", + "description": "Represents 32-bit signed integers (§3.3.17)", + "examples": [ 0, 1, -1, 2147483647, -2147483648, 42, -999 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#int" ], + "$ref": "../../../iso/c/2024/int32.json" +} diff --git a/schemas/w3c/xmlschema/2001/integer.json b/schemas/w3c/xmlschema/2001/integer.json new file mode 100644 index 0000000..cb3fb33 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/integer.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema integer", + "description": "Represents arbitrary-sized integers derived from decimal (§3.3.13)", + "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", + "examples": [ + "0", + "1", + "-1", + "42", + "-273", + "12678967543233", + "-9999999999999999", + "999999999999999999999999999999" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#integer" ], + "type": "string", + "pattern": "^[+-]?(0|[1-9][0-9]*)$" +} diff --git a/schemas/w3c/xmlschema/2001/language.json b/schemas/w3c/xmlschema/2001/language.json new file mode 100644 index 0000000..33681e6 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/language.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema language", + "description": "Represents natural language identifiers as defined by RFC 3066 (§3.3.3)", + "examples": [ "en", "en-US", "fr-FR", "de-DE", "ja", "zh-CN" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ + "https://www.w3.org/TR/xmlschema-2/#language", + "https://www.rfc-editor.org/rfc/rfc3066.html" + ], + "$ref": "../../../ietf/language/3066/tag-syntax.json" +} diff --git a/schemas/w3c/xmlschema/2001/long.json b/schemas/w3c/xmlschema/2001/long.json new file mode 100644 index 0000000..4dd692f --- /dev/null +++ b/schemas/w3c/xmlschema/2001/long.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema long", + "description": "Represents 64-bit signed integers (§3.3.16)", + "examples": [ + 0, + 1, + -1, + 9223372036854775807, + -9223372036854775808, + 1000000000, + -1000000000 + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#long" ], + "$ref": "../../../iso/c/2024/int64.json" +} diff --git a/schemas/w3c/xmlschema/2001/negative-integer.json b/schemas/w3c/xmlschema/2001/negative-integer.json new file mode 100644 index 0000000..cd2c0f4 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/negative-integer.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema negativeInteger", + "description": "Represents strictly negative integers (§3.3.15)", + "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", + "examples": [ + "-1", + "-42", + "-1000", + "-9223372036854775808", + "-999999999999999999999999999999" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#negativeInteger" ], + "type": "string", + "pattern": "^-[1-9][0-9]*$" +} diff --git a/schemas/w3c/xmlschema/2001/non-negative-integer.json b/schemas/w3c/xmlschema/2001/non-negative-integer.json new file mode 100644 index 0000000..f62c2a1 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/non-negative-integer.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema nonNegativeInteger", + "description": "Represents integers greater than or equal to zero (§3.3.20)", + "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", + "examples": [ + "0", + "1", + "42", + "1000", + "9223372036854775807", + "999999999999999999999999999999" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#nonNegativeInteger" ], + "type": "string", + "pattern": "^(0|[1-9][0-9]*)$" +} diff --git a/schemas/w3c/xmlschema/2001/non-positive-integer.json b/schemas/w3c/xmlschema/2001/non-positive-integer.json new file mode 100644 index 0000000..a8b248d --- /dev/null +++ b/schemas/w3c/xmlschema/2001/non-positive-integer.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema nonPositiveInteger", + "description": "Represents integers less than or equal to zero (§3.3.14)", + "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", + "examples": [ + "0", + "-1", + "-42", + "-1000", + "-9223372036854775808", + "-999999999999999999999999999999" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#nonPositiveInteger" ], + "type": "string", + "pattern": "^(0|-[1-9][0-9]*)$" +} diff --git a/schemas/w3c/xmlschema/2001/normalized-string.json b/schemas/w3c/xmlschema/2001/normalized-string.json new file mode 100644 index 0000000..50577c9 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/normalized-string.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema normalizedString", + "description": "Represents white space normalized strings (§3.3.1)", + "examples": [ + "This is a normalized string", + "Multiple spaces are allowed", + "Leading and trailing spaces are allowed ", + " Also leading spaces", + "", + "Unicode: 你好世界", + "Special chars: @#$%^&*()" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#normalizedString" ], + "$ref": "string.json", + "not": { + "$comment": "Carriage return (#xD), line feed (#xA), and tab (#x9) are not allowed", + "pattern": "[\\r\\n\\t]" + } +} diff --git a/schemas/w3c/xmlschema/2001/positive-integer.json b/schemas/w3c/xmlschema/2001/positive-integer.json new file mode 100644 index 0000000..087f50c --- /dev/null +++ b/schemas/w3c/xmlschema/2001/positive-integer.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema positiveInteger", + "description": "Represents strictly positive integers (§3.3.25)", + "$comment": "XML Schema supports arbitrary precision. JSON Schema's integer type is limited to the 64-bit range for safe interoperability per RFC 8259. This schema uses string representation to maintain XML Schema's arbitrary precision semantics", + "examples": [ + "1", + "42", + "1000", + "9223372036854775807", + "999999999999999999999999999999" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#positiveInteger" ], + "type": "string", + "pattern": "^[1-9][0-9]*$" +} diff --git a/schemas/w3c/xmlschema/2001/short.json b/schemas/w3c/xmlschema/2001/short.json new file mode 100644 index 0000000..471ec01 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/short.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema short", + "description": "Represents 16-bit signed integers (§3.3.18)", + "examples": [ 0, 1, -1, 32767, -32768, 1000, -1000 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#short" ], + "$ref": "../../../iso/c/2024/int16.json" +} diff --git a/schemas/w3c/xmlschema/2001/token.json b/schemas/w3c/xmlschema/2001/token.json new file mode 100644 index 0000000..15fded4 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/token.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema token", + "description": "Represents tokenized strings (§3.3.2)", + "examples": [ + "single", + "two words", + "multiple single spaces here", + "no-spaces-just-hyphens", + "under_scores_allowed", + "MixedCase123", + "你好" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#token" ], + "$ref": "normalized-string.json", + "not": { + "$comment": "Leading space, trailing space, and two or more consecutive spaces are not allowed", + "pattern": "(^ | $| )" + } +} diff --git a/schemas/w3c/xmlschema/2001/unsigned-byte.json b/schemas/w3c/xmlschema/2001/unsigned-byte.json new file mode 100644 index 0000000..d7d61b8 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/unsigned-byte.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema unsignedByte", + "description": "Represents 8-bit unsigned integers (§3.3.24)", + "examples": [ 0, 1, 255, 128, 42 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#unsignedByte" ], + "$ref": "../../../iso/c/2024/uint8.json" +} diff --git a/schemas/w3c/xmlschema/2001/unsigned-int.json b/schemas/w3c/xmlschema/2001/unsigned-int.json new file mode 100644 index 0000000..662b6eb --- /dev/null +++ b/schemas/w3c/xmlschema/2001/unsigned-int.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema unsignedInt", + "description": "Represents 32-bit unsigned integers (§3.3.22)", + "examples": [ 0, 1, 4294967295, 2147483648, 42 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#unsignedInt" ], + "$ref": "../../../iso/c/2024/uint32.json" +} diff --git a/schemas/w3c/xmlschema/2001/unsigned-long.json b/schemas/w3c/xmlschema/2001/unsigned-long.json new file mode 100644 index 0000000..c8b8ba0 --- /dev/null +++ b/schemas/w3c/xmlschema/2001/unsigned-long.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema unsignedLong", + "description": "Represents 64-bit unsigned integers (§3.3.21)", + "$comment": "XML Schema unsignedLong supports the 64-bit unsigned range, but JSON Schema's integer type is limited to signed 64-bit integers. This schema uses string representation to maintain full XML Schema conformance", + "examples": [ + "0", + "1", + "18446744073709551615", + "9223372036854775808", + "4294967296" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#unsignedLong" ], + "type": "string", + "anyOf": [ + { + "pattern": "^0$" + }, + { + "pattern": "^[1-9][0-9]{0,18}$" + }, + { + "pattern": "^1[0-7][0-9]{18}$" + }, + { + "pattern": "^18[0-3][0-9]{17}$" + }, + { + "pattern": "^184[0-3][0-9]{16}$" + }, + { + "pattern": "^1844[0-5][0-9]{15}$" + }, + { + "pattern": "^18446[0-6][0-9]{14}$" + }, + { + "pattern": "^184467[0-3][0-9]{13}$" + }, + { + "pattern": "^1844674[0-3][0-9]{12}$" + }, + { + "pattern": "^184467440[0-6][0-9]{10}$" + }, + { + "pattern": "^1844674407[0-2][0-9]{9}$" + }, + { + "pattern": "^18446744073[0-6][0-9]{8}$" + }, + { + "pattern": "^1844674407370[0-8][0-9]{6}$" + }, + { + "pattern": "^18446744073709[0-4][0-9]{5}$" + }, + { + "pattern": "^184467440737095[0-4][0-9]{4}$" + }, + { + "pattern": "^1844674407370955[0][0-9]{3}$" + }, + { + "pattern": "^18446744073709551[0-5][0-9]{2}$" + }, + { + "pattern": "^184467440737095516[0][0-9]$" + }, + { + "pattern": "^1844674407370955161[0-5]$" + } + ] +} diff --git a/schemas/w3c/xmlschema/2001/unsigned-short.json b/schemas/w3c/xmlschema/2001/unsigned-short.json new file mode 100644 index 0000000..c81c48d --- /dev/null +++ b/schemas/w3c/xmlschema/2001/unsigned-short.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "W3C XML Schema unsignedShort", + "description": "Represents 16-bit unsigned integers (§3.3.23)", + "examples": [ 0, 1, 65535, 32768, 1000 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.w3.org/TR/xmlschema-2/#unsignedShort" ], + "$ref": "../../../iso/c/2024/uint16.json" +} diff --git a/test/w3c/xmlschema/2001/byte.test.json b/test/w3c/xmlschema/2001/byte.test.json new file mode 100644 index 0000000..f8b01f9 --- /dev/null +++ b/test/w3c/xmlschema/2001/byte.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/byte.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - positive one", + "data": 1, + "valid": true + }, + { + "description": "Valid - negative one", + "data": -1, + "valid": true + }, + { + "description": "Valid - maximum (127)", + "data": 127, + "valid": true + }, + { + "description": "Valid - minimum (-128)", + "data": -128, + "valid": true + }, + { + "description": "Valid - arbitrary positive", + "data": 42, + "valid": true + }, + { + "description": "Valid - arbitrary negative", + "data": -99, + "valid": true + }, + { + "description": "Invalid: too large (128)", + "data": 128, + "valid": false + }, + { + "description": "Invalid: too small (-129)", + "data": -129, + "valid": false + }, + { + "description": "Invalid: much too large", + "data": 1000, + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": 1.5, + "valid": false + }, + { + "description": "Invalid: string", + "data": "42", + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/int.test.json b/test/w3c/xmlschema/2001/int.test.json new file mode 100644 index 0000000..211135c --- /dev/null +++ b/test/w3c/xmlschema/2001/int.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/int.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - positive one", + "data": 1, + "valid": true + }, + { + "description": "Valid - negative one", + "data": -1, + "valid": true + }, + { + "description": "Valid - maximum (2147483647)", + "data": 2147483647, + "valid": true + }, + { + "description": "Valid - minimum (-2147483648)", + "data": -2147483648, + "valid": true + }, + { + "description": "Valid - arbitrary positive", + "data": 42, + "valid": true + }, + { + "description": "Valid - arbitrary negative", + "data": -999, + "valid": true + }, + { + "description": "Invalid: too large (2147483648)", + "data": 2147483648, + "valid": false + }, + { + "description": "Invalid: too small (-2147483649)", + "data": -2147483649, + "valid": false + }, + { + "description": "Invalid: much too large", + "data": 10000000000, + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": 1.5, + "valid": false + }, + { + "description": "Invalid: string", + "data": "42", + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/integer.test.json b/test/w3c/xmlschema/2001/integer.test.json new file mode 100644 index 0000000..3df3585 --- /dev/null +++ b/test/w3c/xmlschema/2001/integer.test.json @@ -0,0 +1,118 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/integer.json", + "tests": [ + { + "description": "Valid - zero", + "data": "0", + "valid": true + }, + { + "description": "Valid - positive small", + "data": "1", + "valid": true + }, + { + "description": "Valid - negative small", + "data": "-1", + "valid": true + }, + { + "description": "Valid - positive large", + "data": "9223372036854775807", + "valid": true + }, + { + "description": "Valid - negative large", + "data": "-9223372036854775808", + "valid": true + }, + { + "description": "Valid - arbitrary positive", + "data": "42", + "valid": true + }, + { + "description": "Valid - arbitrary negative", + "data": "-273", + "valid": true + }, + { + "description": "Valid - medium positive", + "data": "1000000", + "valid": true + }, + { + "description": "Valid - medium negative", + "data": "-1000000", + "valid": true + }, + { + "description": "Valid - very large (beyond 64-bit)", + "data": "999999999999999999999999999999", + "valid": true + }, + { + "description": "Valid - very small (beyond 64-bit)", + "data": "-999999999999999999999999999999", + "valid": true + }, + { + "description": "Valid - with plus sign", + "data": "+42", + "valid": true + }, + { + "description": "Invalid: decimal number", + "data": "1.5", + "valid": false + }, + { + "description": "Invalid: leading zeros", + "data": "01", + "valid": false + }, + { + "description": "Invalid: negative zero with leading zeros", + "data": "-00", + "valid": false + }, + { + "description": "Invalid: whitespace", + "data": " 42 ", + "valid": false + }, + { + "description": "Invalid: number type", + "data": 42, + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + }, + { + "description": "Invalid: array", + "data": [ "42" ], + "valid": false + }, + { + "description": "Invalid: object", + "data": { + "value": "42" + }, + "valid": false + }, + { + "description": "Invalid: empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/language.test.json b/test/w3c/xmlschema/2001/language.test.json new file mode 100644 index 0000000..d285da4 --- /dev/null +++ b/test/w3c/xmlschema/2001/language.test.json @@ -0,0 +1,71 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/language.json", + "tests": [ + { + "description": "Valid - English", + "data": "en", + "valid": true + }, + { + "description": "Valid - English US", + "data": "en-US", + "valid": true + }, + { + "description": "Valid - French", + "data": "fr", + "valid": true + }, + { + "description": "Valid - German Germany", + "data": "de-DE", + "valid": true + }, + { + "description": "Valid - Chinese", + "data": "zh-CN", + "valid": true + }, + { + "description": "Valid - Japanese", + "data": "ja", + "valid": true + }, + { + "description": "Valid - private use", + "data": "x-private", + "valid": true + }, + { + "description": "Valid - multiple subtags", + "data": "en-US-x-twain", + "valid": true + }, + { + "description": "Invalid: empty string", + "data": "", + "valid": false + }, + { + "description": "Invalid: too long primary", + "data": "abcdefghi", + "valid": false + }, + { + "description": "Invalid: contains space", + "data": "en US", + "valid": false + }, + { + "description": "Invalid: contains underscore", + "data": "en_US", + "valid": false + }, + { + "description": "Type validation: not a string", + "data": 123, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/long.test.json b/test/w3c/xmlschema/2001/long.test.json new file mode 100644 index 0000000..fc77237 --- /dev/null +++ b/test/w3c/xmlschema/2001/long.test.json @@ -0,0 +1,71 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/long.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - positive one", + "data": 1, + "valid": true + }, + { + "description": "Valid - negative one", + "data": -1, + "valid": true + }, + { + "description": "Valid - maximum (9223372036854775807)", + "data": 9223372036854775807, + "valid": true + }, + { + "description": "Valid - minimum (-9223372036854775808)", + "data": -9223372036854775808, + "valid": true + }, + { + "description": "Valid - arbitrary positive", + "data": 1000000000, + "valid": true + }, + { + "description": "Valid - arbitrary negative", + "data": -1000000000, + "valid": true + }, + { + "description": "Valid - within int32 range", + "data": 2147483647, + "valid": true + }, + { + "description": "Valid - beyond int32 range", + "data": 2147483648, + "valid": true + }, + { + "description": "Invalid: decimal number", + "data": 1.5, + "valid": false + }, + { + "description": "Invalid: string", + "data": "1000000000", + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/negative-integer.test.json b/test/w3c/xmlschema/2001/negative-integer.test.json new file mode 100644 index 0000000..9d48eac --- /dev/null +++ b/test/w3c/xmlschema/2001/negative-integer.test.json @@ -0,0 +1,81 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/negative-integer.json", + "tests": [ + { + "description": "Valid - negative one (boundary)", + "data": "-1", + "valid": true + }, + { + "description": "Valid - negative two", + "data": "-2", + "valid": true + }, + { + "description": "Valid - small negative", + "data": "-42", + "valid": true + }, + { + "description": "Valid - large negative", + "data": "-9223372036854775808", + "valid": true + }, + { + "description": "Valid - medium negative", + "data": "-1000", + "valid": true + }, + { + "description": "Valid - very small (beyond 64-bit)", + "data": "-999999999999999999999999999999", + "valid": true + }, + { + "description": "Invalid: zero (just above boundary)", + "data": "0", + "valid": false + }, + { + "description": "Invalid: positive one", + "data": "1", + "valid": false + }, + { + "description": "Invalid: small positive", + "data": "42", + "valid": false + }, + { + "description": "Invalid: large positive", + "data": "9223372036854775807", + "valid": false + }, + { + "description": "Invalid: leading zeros", + "data": "-01", + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": "-1.5", + "valid": false + }, + { + "description": "Invalid: number type", + "data": -42, + "valid": false + }, + { + "description": "Invalid: boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/non-negative-integer.test.json b/test/w3c/xmlschema/2001/non-negative-integer.test.json new file mode 100644 index 0000000..d3d376a --- /dev/null +++ b/test/w3c/xmlschema/2001/non-negative-integer.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/non-negative-integer.json", + "tests": [ + { + "description": "Valid - zero (boundary)", + "data": "0", + "valid": true + }, + { + "description": "Valid - one", + "data": "1", + "valid": true + }, + { + "description": "Valid - small positive", + "data": "42", + "valid": true + }, + { + "description": "Valid - large positive", + "data": "9223372036854775807", + "valid": true + }, + { + "description": "Valid - medium positive", + "data": "1000", + "valid": true + }, + { + "description": "Valid - very large (beyond 64-bit)", + "data": "999999999999999999999999999999", + "valid": true + }, + { + "description": "Invalid: negative one (just below boundary)", + "data": "-1", + "valid": false + }, + { + "description": "Invalid: small negative", + "data": "-42", + "valid": false + }, + { + "description": "Invalid: large negative", + "data": "-9223372036854775808", + "valid": false + }, + { + "description": "Invalid: leading zeros", + "data": "01", + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": "1.5", + "valid": false + }, + { + "description": "Invalid: number type", + "data": 42, + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/non-positive-integer.test.json b/test/w3c/xmlschema/2001/non-positive-integer.test.json new file mode 100644 index 0000000..db270eb --- /dev/null +++ b/test/w3c/xmlschema/2001/non-positive-integer.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/non-positive-integer.json", + "tests": [ + { + "description": "Valid - zero (boundary)", + "data": "0", + "valid": true + }, + { + "description": "Valid - negative one", + "data": "-1", + "valid": true + }, + { + "description": "Valid - small negative", + "data": "-42", + "valid": true + }, + { + "description": "Valid - large negative", + "data": "-9223372036854775808", + "valid": true + }, + { + "description": "Valid - medium negative", + "data": "-1000", + "valid": true + }, + { + "description": "Valid - very small (beyond 64-bit)", + "data": "-999999999999999999999999999999", + "valid": true + }, + { + "description": "Invalid: positive one (just above boundary)", + "data": "1", + "valid": false + }, + { + "description": "Invalid: small positive", + "data": "42", + "valid": false + }, + { + "description": "Invalid: large positive", + "data": "9223372036854775807", + "valid": false + }, + { + "description": "Invalid: leading zeros on negative", + "data": "-01", + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": "-1.5", + "valid": false + }, + { + "description": "Invalid: number type", + "data": -42, + "valid": false + }, + { + "description": "Invalid: boolean", + "data": false, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/normalized-string.test.json b/test/w3c/xmlschema/2001/normalized-string.test.json new file mode 100644 index 0000000..797b155 --- /dev/null +++ b/test/w3c/xmlschema/2001/normalized-string.test.json @@ -0,0 +1,338 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/normalized-string.json", + "tests": [ + { + "description": "Valid - empty string", + "data": "", + "valid": true + }, + { + "description": "Valid - simple text", + "data": "Hello World", + "valid": true + }, + { + "description": "Valid - single word", + "data": "Hello", + "valid": true + }, + { + "description": "Valid - text with single spaces", + "data": "This is a test", + "valid": true + }, + { + "description": "Valid - text with multiple consecutive spaces", + "data": "Multiple spaces are allowed", + "valid": true + }, + { + "description": "Valid - text with many consecutive spaces", + "data": "Many spaces here", + "valid": true + }, + { + "description": "Valid - leading space", + "data": " Leading space", + "valid": true + }, + { + "description": "Valid - trailing space", + "data": "Trailing space ", + "valid": true + }, + { + "description": "Valid - leading and trailing spaces", + "data": " Both sides ", + "valid": true + }, + { + "description": "Valid - multiple leading spaces", + "data": " Multiple leading", + "valid": true + }, + { + "description": "Valid - multiple trailing spaces", + "data": "Multiple trailing ", + "valid": true + }, + { + "description": "Valid - only spaces", + "data": " ", + "valid": true + }, + { + "description": "Valid - single space", + "data": " ", + "valid": true + }, + { + "description": "Valid - text with numbers", + "data": "Order 123 confirmed", + "valid": true + }, + { + "description": "Valid - numbers only", + "data": "123456", + "valid": true + }, + { + "description": "Valid - special characters", + "data": "Special: @#$%^&*()", + "valid": true + }, + { + "description": "Valid - punctuation", + "data": "Hello, World! How are you?", + "valid": true + }, + { + "description": "Valid - hyphens and underscores", + "data": "hello-world_test", + "valid": true + }, + { + "description": "Valid - dots and commas", + "data": "first.name, last.name", + "valid": true + }, + { + "description": "Valid - parentheses and brackets", + "data": "Text (with) [brackets] {braces}", + "valid": true + }, + { + "description": "Valid - quotes", + "data": "He said \"hello\" and 'goodbye'", + "valid": true + }, + { + "description": "Valid - slashes", + "data": "path/to/file or back\\slash", + "valid": true + }, + { + "description": "Valid - equals and plus", + "data": "a=b+c", + "valid": true + }, + { + "description": "Valid - angle brackets", + "data": "content", + "valid": true + }, + { + "description": "Valid - Unicode Latin Extended", + "data": "Café résumé naïve", + "valid": true + }, + { + "description": "Valid - Unicode Greek", + "data": "Γεια σου κόσμε", + "valid": true + }, + { + "description": "Valid - Unicode Cyrillic", + "data": "Привет мир", + "valid": true + }, + { + "description": "Valid - Unicode Chinese", + "data": "你好世界", + "valid": true + }, + { + "description": "Valid - Unicode Japanese", + "data": "こんにちは世界", + "valid": true + }, + { + "description": "Valid - Unicode Korean", + "data": "안녕하세요 세계", + "valid": true + }, + { + "description": "Valid - Unicode Arabic", + "data": "مرحبا بالعالم", + "valid": true + }, + { + "description": "Valid - Unicode Hebrew", + "data": "שלום עולם", + "valid": true + }, + { + "description": "Valid - Unicode Emoji", + "data": "Hello 👋 World 🌍", + "valid": true + }, + { + "description": "Valid - mixed Unicode scripts", + "data": "Hello 世界 мир κόσμος", + "valid": true + }, + { + "description": "Valid - very long string with spaces", + "data": "This is a very long normalized string with many words separated by single spaces and it should still be valid", + "valid": true + }, + { + "description": "Invalid: contains line feed at start", + "data": "\nHello", + "valid": false + }, + { + "description": "Invalid: contains line feed at end", + "data": "Hello\n", + "valid": false + }, + { + "description": "Invalid: contains line feed in middle", + "data": "Hello\nWorld", + "valid": false + }, + { + "description": "Invalid: contains multiple line feeds", + "data": "Line1\nLine2\nLine3", + "valid": false + }, + { + "description": "Invalid: only line feed", + "data": "\n", + "valid": false + }, + { + "description": "Invalid: contains carriage return at start", + "data": "\rHello", + "valid": false + }, + { + "description": "Invalid: contains carriage return at end", + "data": "Hello\r", + "valid": false + }, + { + "description": "Invalid: contains carriage return in middle", + "data": "Hello\rWorld", + "valid": false + }, + { + "description": "Invalid: contains multiple carriage returns", + "data": "Line1\rLine2\rLine3", + "valid": false + }, + { + "description": "Invalid: only carriage return", + "data": "\r", + "valid": false + }, + { + "description": "Invalid: contains CRLF", + "data": "Hello\r\nWorld", + "valid": false + }, + { + "description": "Invalid: contains tab at start", + "data": "\tHello", + "valid": false + }, + { + "description": "Invalid: contains tab at end", + "data": "Hello\t", + "valid": false + }, + { + "description": "Invalid: contains tab in middle", + "data": "Hello\tWorld", + "valid": false + }, + { + "description": "Invalid: contains multiple tabs", + "data": "Col1\tCol2\tCol3", + "valid": false + }, + { + "description": "Invalid: only tab", + "data": "\t", + "valid": false + }, + { + "description": "Invalid: tab used for indentation", + "data": "\tIndented text", + "valid": false + }, + { + "description": "Invalid: multiple tabs for indentation", + "data": "\t\tDouble indented", + "valid": false + }, + { + "description": "Invalid: mixed whitespace with tab", + "data": "Hello \tWorld", + "valid": false + }, + { + "description": "Invalid: mixed whitespace with newline", + "data": "Hello \nWorld", + "valid": false + }, + { + "description": "Invalid: all three prohibited characters", + "data": "Line1\r\nLine2\tTabbed", + "valid": false + }, + { + "description": "Invalid: tab between words", + "data": "Word1\tWord2", + "valid": false + }, + { + "description": "Invalid: newline in Unicode text", + "data": "你好\n世界", + "valid": false + }, + { + "description": "Invalid: tab in Unicode text", + "data": "你好\t世界", + "valid": false + }, + { + "description": "Invalid: multiline paragraph", + "data": "First line\nSecond line\nThird line", + "valid": false + }, + { + "description": "Invalid: text with line breaks for formatting", + "data": "Name:\nJohn Doe\nAge: 30", + "valid": false + }, + { + "description": "Type validation: not a string (number)", + "data": 123, + "valid": false + }, + { + "description": "Type validation: not a string (boolean)", + "data": true, + "valid": false + }, + { + "description": "Type validation: not a string (null)", + "data": null, + "valid": false + }, + { + "description": "Type validation: not a string (array)", + "data": [ "Hello", "World" ], + "valid": false + }, + { + "description": "Type validation: not a string (object)", + "data": { + "text": "Hello World" + }, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/positive-integer.test.json b/test/w3c/xmlschema/2001/positive-integer.test.json new file mode 100644 index 0000000..33602e6 --- /dev/null +++ b/test/w3c/xmlschema/2001/positive-integer.test.json @@ -0,0 +1,81 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/positive-integer.json", + "tests": [ + { + "description": "Valid - one (boundary)", + "data": "1", + "valid": true + }, + { + "description": "Valid - two", + "data": "2", + "valid": true + }, + { + "description": "Valid - small positive", + "data": "42", + "valid": true + }, + { + "description": "Valid - large positive", + "data": "9223372036854775807", + "valid": true + }, + { + "description": "Valid - medium positive", + "data": "1000", + "valid": true + }, + { + "description": "Valid - very large (beyond 64-bit)", + "data": "999999999999999999999999999999", + "valid": true + }, + { + "description": "Invalid: zero (just below boundary)", + "data": "0", + "valid": false + }, + { + "description": "Invalid: negative one", + "data": "-1", + "valid": false + }, + { + "description": "Invalid: small negative", + "data": "-42", + "valid": false + }, + { + "description": "Invalid: large negative", + "data": "-9223372036854775808", + "valid": false + }, + { + "description": "Invalid: leading zeros", + "data": "01", + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": "1.5", + "valid": false + }, + { + "description": "Invalid: number type", + "data": 42, + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/short.test.json b/test/w3c/xmlschema/2001/short.test.json new file mode 100644 index 0000000..b9f19b9 --- /dev/null +++ b/test/w3c/xmlschema/2001/short.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/short.json", + "tests": [ + { + "description": "Valid - zero", + "data": 0, + "valid": true + }, + { + "description": "Valid - positive one", + "data": 1, + "valid": true + }, + { + "description": "Valid - negative one", + "data": -1, + "valid": true + }, + { + "description": "Valid - maximum (32767)", + "data": 32767, + "valid": true + }, + { + "description": "Valid - minimum (-32768)", + "data": -32768, + "valid": true + }, + { + "description": "Valid - arbitrary positive", + "data": 1000, + "valid": true + }, + { + "description": "Valid - arbitrary negative", + "data": -1000, + "valid": true + }, + { + "description": "Invalid: too large (32768)", + "data": 32768, + "valid": false + }, + { + "description": "Invalid: too small (-32769)", + "data": -32769, + "valid": false + }, + { + "description": "Invalid: much too large", + "data": 100000, + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": 1.5, + "valid": false + }, + { + "description": "Invalid: string", + "data": "1000", + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/token.test.json b/test/w3c/xmlschema/2001/token.test.json new file mode 100644 index 0000000..60cef5c --- /dev/null +++ b/test/w3c/xmlschema/2001/token.test.json @@ -0,0 +1,428 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/token.json", + "tests": [ + { + "description": "Valid - empty string", + "data": "", + "valid": true + }, + { + "description": "Valid - single word", + "data": "Hello", + "valid": true + }, + { + "description": "Valid - two words with single space", + "data": "Hello World", + "valid": true + }, + { + "description": "Valid - three words with single spaces", + "data": "This is text", + "valid": true + }, + { + "description": "Valid - multiple words with single spaces", + "data": "Multiple words separated by single spaces", + "valid": true + }, + { + "description": "Valid - sentence with punctuation", + "data": "Hello, World! How are you?", + "valid": true + }, + { + "description": "Valid - single space between punctuation", + "data": "First, second, third, fourth", + "valid": true + }, + { + "description": "Valid - text with numbers", + "data": "Order 123 confirmed", + "valid": true + }, + { + "description": "Valid - numbers only", + "data": "123456", + "valid": true + }, + { + "description": "Valid - hyphenated words", + "data": "well-known up-to-date", + "valid": true + }, + { + "description": "Valid - no spaces just hyphens", + "data": "no-spaces-just-hyphens", + "valid": true + }, + { + "description": "Valid - underscores", + "data": "snake_case_identifier", + "valid": true + }, + { + "description": "Valid - mixed case", + "data": "MixedCase123", + "valid": true + }, + { + "description": "Valid - dots", + "data": "file.name.extension", + "valid": true + }, + { + "description": "Valid - special characters without spaces", + "data": "@#$%^&*()", + "valid": true + }, + { + "description": "Valid - special characters with single spaces", + "data": "special @ characters # here", + "valid": true + }, + { + "description": "Valid - path-like without spaces", + "data": "path/to/file", + "valid": true + }, + { + "description": "Valid - URL-like", + "data": "https://example.com/path", + "valid": true + }, + { + "description": "Valid - email-like", + "data": "user@example.com", + "valid": true + }, + { + "description": "Valid - quoted text with single spaces", + "data": "He said \"hello\" and left", + "valid": true + }, + { + "description": "Valid - Unicode single word", + "data": "你好", + "valid": true + }, + { + "description": "Valid - Unicode with single spaces", + "data": "你好 世界", + "valid": true + }, + { + "description": "Valid - Unicode Greek with spaces", + "data": "Γεια σου κόσμε", + "valid": true + }, + { + "description": "Valid - Unicode Cyrillic with spaces", + "data": "Привет мир", + "valid": true + }, + { + "description": "Valid - Unicode Japanese with spaces", + "data": "こんにちは 世界", + "valid": true + }, + { + "description": "Valid - Unicode Korean with spaces", + "data": "안녕하세요 세계", + "valid": true + }, + { + "description": "Valid - Unicode Arabic with spaces", + "data": "مرحبا بالعالم", + "valid": true + }, + { + "description": "Valid - Unicode Hebrew with spaces", + "data": "שלום עולם", + "valid": true + }, + { + "description": "Valid - Unicode Emoji with single spaces", + "data": "Hello 👋 World 🌍", + "valid": true + }, + { + "description": "Valid - mixed scripts with single spaces", + "data": "Hello 世界 мир κόσμος", + "valid": true + }, + { + "description": "Valid - Latin Extended with single spaces", + "data": "Café résumé naïve", + "valid": true + }, + { + "description": "Valid - long sentence with single spaces", + "data": "This is a very long tokenized string with many words separated by single spaces only", + "valid": true + }, + { + "description": "Valid - single character", + "data": "a", + "valid": true + }, + { + "description": "Valid - single digit", + "data": "5", + "valid": true + }, + { + "description": "Invalid: leading space", + "data": " Hello", + "valid": false + }, + { + "description": "Invalid: trailing space", + "data": "Hello ", + "valid": false + }, + { + "description": "Invalid: leading and trailing spaces", + "data": " Hello ", + "valid": false + }, + { + "description": "Invalid: multiple leading spaces", + "data": " Hello", + "valid": false + }, + { + "description": "Invalid: multiple trailing spaces", + "data": "Hello ", + "valid": false + }, + { + "description": "Invalid: single space only", + "data": " ", + "valid": false + }, + { + "description": "Invalid: multiple spaces only", + "data": " ", + "valid": false + }, + { + "description": "Invalid: two consecutive spaces in middle", + "data": "Hello World", + "valid": false + }, + { + "description": "Invalid: three consecutive spaces in middle", + "data": "Hello World", + "valid": false + }, + { + "description": "Invalid: many consecutive spaces in middle", + "data": "Hello World", + "valid": false + }, + { + "description": "Invalid: double spaces between multiple words", + "data": "First second third", + "valid": false + }, + { + "description": "Invalid: mixed single and double spaces", + "data": "One two three four", + "valid": false + }, + { + "description": "Invalid: leading space with valid spacing after", + "data": " Hello World", + "valid": false + }, + { + "description": "Invalid: trailing space with valid spacing before", + "data": "Hello World ", + "valid": false + }, + { + "description": "Invalid: both leading and double space", + "data": " Hello World", + "valid": false + }, + { + "description": "Invalid: both trailing and double space", + "data": "Hello World ", + "valid": false + }, + { + "description": "Invalid: all spacing violations", + "data": " Hello World ", + "valid": false + }, + { + "description": "Invalid: double space in Unicode text", + "data": "你好 世界", + "valid": false + }, + { + "description": "Invalid: leading space in Unicode text", + "data": " 你好", + "valid": false + }, + { + "description": "Invalid: trailing space in Unicode text", + "data": "你好 ", + "valid": false + }, + { + "description": "Invalid: contains line feed at start", + "data": "\nHello", + "valid": false + }, + { + "description": "Invalid: contains line feed at end", + "data": "Hello\n", + "valid": false + }, + { + "description": "Invalid: contains line feed in middle", + "data": "Hello\nWorld", + "valid": false + }, + { + "description": "Invalid: contains multiple line feeds", + "data": "Line1\nLine2\nLine3", + "valid": false + }, + { + "description": "Invalid: only line feed", + "data": "\n", + "valid": false + }, + { + "description": "Invalid: contains carriage return at start", + "data": "\rHello", + "valid": false + }, + { + "description": "Invalid: contains carriage return at end", + "data": "Hello\r", + "valid": false + }, + { + "description": "Invalid: contains carriage return in middle", + "data": "Hello\rWorld", + "valid": false + }, + { + "description": "Invalid: contains multiple carriage returns", + "data": "Line1\rLine2\rLine3", + "valid": false + }, + { + "description": "Invalid: only carriage return", + "data": "\r", + "valid": false + }, + { + "description": "Invalid: contains CRLF", + "data": "Hello\r\nWorld", + "valid": false + }, + { + "description": "Invalid: contains tab at start", + "data": "\tHello", + "valid": false + }, + { + "description": "Invalid: contains tab at end", + "data": "Hello\t", + "valid": false + }, + { + "description": "Invalid: contains tab in middle", + "data": "Hello\tWorld", + "valid": false + }, + { + "description": "Invalid: contains multiple tabs", + "data": "Col1\tCol2\tCol3", + "valid": false + }, + { + "description": "Invalid: only tab", + "data": "\t", + "valid": false + }, + { + "description": "Invalid: tab used for spacing", + "data": "Hello\tWorld", + "valid": false + }, + { + "description": "Invalid: mixed whitespace with tab", + "data": "Hello \tWorld", + "valid": false + }, + { + "description": "Invalid: mixed whitespace with newline", + "data": "Hello \nWorld", + "valid": false + }, + { + "description": "Invalid: all prohibited characters", + "data": "Line1\r\nLine2\tTabbed", + "valid": false + }, + { + "description": "Invalid: newline in Unicode text", + "data": "你好\n世界", + "valid": false + }, + { + "description": "Invalid: tab in Unicode text", + "data": "你好\t世界", + "valid": false + }, + { + "description": "Invalid: multiline paragraph", + "data": "First line\nSecond line\nThird line", + "valid": false + }, + { + "description": "Invalid: leading space and newline", + "data": " Hello\nWorld", + "valid": false + }, + { + "description": "Invalid: trailing space and tab", + "data": "Hello\tWorld ", + "valid": false + }, + { + "description": "Type validation: not a string (number)", + "data": 123, + "valid": false + }, + { + "description": "Type validation: not a string (boolean)", + "data": true, + "valid": false + }, + { + "description": "Type validation: not a string (null)", + "data": null, + "valid": false + }, + { + "description": "Type validation: not a string (array)", + "data": [ "Hello", "World" ], + "valid": false + }, + { + "description": "Type validation: not a string (object)", + "data": { + "text": "Hello World" + }, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/unsigned-byte.test.json b/test/w3c/xmlschema/2001/unsigned-byte.test.json new file mode 100644 index 0000000..bd0991c --- /dev/null +++ b/test/w3c/xmlschema/2001/unsigned-byte.test.json @@ -0,0 +1,71 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/unsigned-byte.json", + "tests": [ + { + "description": "Valid - zero (minimum)", + "data": 0, + "valid": true + }, + { + "description": "Valid - one", + "data": 1, + "valid": true + }, + { + "description": "Valid - maximum (255)", + "data": 255, + "valid": true + }, + { + "description": "Valid - mid-range (128)", + "data": 128, + "valid": true + }, + { + "description": "Valid - arbitrary", + "data": 42, + "valid": true + }, + { + "description": "Invalid: too large (256)", + "data": 256, + "valid": false + }, + { + "description": "Invalid: much too large", + "data": 1000, + "valid": false + }, + { + "description": "Invalid: negative one", + "data": -1, + "valid": false + }, + { + "description": "Invalid: negative value", + "data": -100, + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": 1.5, + "valid": false + }, + { + "description": "Invalid: string", + "data": "42", + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/unsigned-int.test.json b/test/w3c/xmlschema/2001/unsigned-int.test.json new file mode 100644 index 0000000..d132726 --- /dev/null +++ b/test/w3c/xmlschema/2001/unsigned-int.test.json @@ -0,0 +1,71 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/unsigned-int.json", + "tests": [ + { + "description": "Valid - zero (minimum)", + "data": 0, + "valid": true + }, + { + "description": "Valid - one", + "data": 1, + "valid": true + }, + { + "description": "Valid - maximum (4294967295)", + "data": 4294967295, + "valid": true + }, + { + "description": "Valid - mid-range (2147483648)", + "data": 2147483648, + "valid": true + }, + { + "description": "Valid - arbitrary", + "data": 42, + "valid": true + }, + { + "description": "Invalid: too large (4294967296)", + "data": 4294967296, + "valid": false + }, + { + "description": "Invalid: much too large", + "data": 10000000000, + "valid": false + }, + { + "description": "Invalid: negative one", + "data": -1, + "valid": false + }, + { + "description": "Invalid: negative value", + "data": -1000, + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": 1.5, + "valid": false + }, + { + "description": "Invalid: string", + "data": "42", + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/unsigned-long.test.json b/test/w3c/xmlschema/2001/unsigned-long.test.json new file mode 100644 index 0000000..acc23d3 --- /dev/null +++ b/test/w3c/xmlschema/2001/unsigned-long.test.json @@ -0,0 +1,176 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/unsigned-long.json", + "tests": [ + { + "description": "Valid - zero (minimum)", + "data": "0", + "valid": true + }, + { + "description": "Valid - one", + "data": "1", + "valid": true + }, + { + "description": "Valid - maximum (18446744073709551615)", + "data": "18446744073709551615", + "valid": true + }, + { + "description": "Valid - above int64 max (9223372036854775808)", + "data": "9223372036854775808", + "valid": true + }, + { + "description": "Valid - int64 max (9223372036854775807)", + "data": "9223372036854775807", + "valid": true + }, + { + "description": "Valid - uint32 max (4294967296)", + "data": "4294967296", + "valid": true + }, + { + "description": "Valid - arbitrary", + "data": "42", + "valid": true + }, + { + "description": "Valid - maximum value (18446744073709551615)", + "data": "18446744073709551615", + "valid": true + }, + { + "description": "Valid - one below maximum (18446744073709551614)", + "data": "18446744073709551614", + "valid": true + }, + { + "description": "Valid - 19 digits maximum (9999999999999999999)", + "data": "9999999999999999999", + "valid": true + }, + { + "description": "Valid - 20 digits starting with 1, second digit < 8", + "data": "17999999999999999999", + "valid": true + }, + { + "description": "Valid - 20 digits: 18399999999999999999", + "data": "18399999999999999999", + "valid": true + }, + { + "description": "Valid - 20 digits: 18446744073709551600", + "data": "18446744073709551600", + "valid": true + }, + { + "description": "Valid - no leading zeros for non-zero", + "data": "123", + "valid": true + }, + { + "description": "Invalid: exceeds maximum by 1 (18446744073709551616)", + "data": "18446744073709551616", + "valid": false + }, + { + "description": "Invalid: exceeds maximum (18446744073709551617)", + "data": "18446744073709551617", + "valid": false + }, + { + "description": "Invalid: exceeds maximum (18446744073709551620)", + "data": "18446744073709551620", + "valid": false + }, + { + "description": "Invalid: 20 digits starting with 2", + "data": "20000000000000000000", + "valid": false + }, + { + "description": "Invalid: 20 digits: 19999999999999999999", + "data": "19999999999999999999", + "valid": false + }, + { + "description": "Invalid: 20 digits: 18499999999999999999", + "data": "18499999999999999999", + "valid": false + }, + { + "description": "Invalid: 20 digits: 18446744073709551619", + "data": "18446744073709551619", + "valid": false + }, + { + "description": "Invalid: 21 digits", + "data": "100000000000000000000", + "valid": false + }, + { + "description": "Invalid: negative sign", + "data": "-1", + "valid": false + }, + { + "description": "Invalid: negative value", + "data": "-1000", + "valid": false + }, + { + "description": "Invalid: decimal point", + "data": "1.5", + "valid": false + }, + { + "description": "Invalid: positive sign", + "data": "+1", + "valid": false + }, + { + "description": "Invalid: leading zeros", + "data": "01", + "valid": false + }, + { + "description": "Invalid: leading zeros multiple", + "data": "0042", + "valid": false + }, + { + "description": "Invalid: number type", + "data": 42, + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + }, + { + "description": "Invalid: empty string", + "data": "", + "valid": false + }, + { + "description": "Invalid: whitespace", + "data": " 42 ", + "valid": false + }, + { + "description": "Invalid: non-digit characters", + "data": "12abc", + "valid": false + } + ] +} diff --git a/test/w3c/xmlschema/2001/unsigned-short.test.json b/test/w3c/xmlschema/2001/unsigned-short.test.json new file mode 100644 index 0000000..e8d0a64 --- /dev/null +++ b/test/w3c/xmlschema/2001/unsigned-short.test.json @@ -0,0 +1,71 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/w3c/xmlschema/2001/unsigned-short.json", + "tests": [ + { + "description": "Valid - zero (minimum)", + "data": 0, + "valid": true + }, + { + "description": "Valid - one", + "data": 1, + "valid": true + }, + { + "description": "Valid - maximum (65535)", + "data": 65535, + "valid": true + }, + { + "description": "Valid - mid-range (32768)", + "data": 32768, + "valid": true + }, + { + "description": "Valid - arbitrary", + "data": 1000, + "valid": true + }, + { + "description": "Invalid: too large (65536)", + "data": 65536, + "valid": false + }, + { + "description": "Invalid: much too large", + "data": 100000, + "valid": false + }, + { + "description": "Invalid: negative one", + "data": -1, + "valid": false + }, + { + "description": "Invalid: negative value", + "data": -1000, + "valid": false + }, + { + "description": "Invalid: decimal number", + "data": 1.5, + "valid": false + }, + { + "description": "Invalid: string", + "data": "1000", + "valid": false + }, + { + "description": "Invalid: boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid: null", + "data": null, + "valid": false + } + ] +}