[
	{
		"description": "ECMA 262 regex $ does not match trailing newline",
		"schema": {
			"type": "string",
			"pattern": "^abc$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "matches in Python, but not in ECMA 262",
				"data": "abc\\n",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "matches",
				"data": "abc",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 regex converts \\t to horizontal tab",
		"schema": {
			"type": "string",
			"pattern": "^\\t$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "does not match",
				"data": "\\t",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "matches",
				"data": "\t",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 regex escapes control codes with \\c and upper letter",
		"schema": {
			"type": "string",
			"pattern": "^\\cC$"
		},
		"skip": {
			"v3": "extract error: invalid regexp \"^\\\\cC$\": error parsing regexp: invalid escape sequence: `\\c`",
			"v3-roundtrip": "inital extract failed"
		},
		"tests": [
			{
				"description": "does not match",
				"data": "\\cC",
				"valid": false,
				"skip": {
					"v3": "could not extract schema",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "matches",
				"data": "\u0003",
				"valid": true,
				"skip": {
					"v3": "could not extract schema",
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 regex escapes control codes with \\c and lower letter",
		"schema": {
			"type": "string",
			"pattern": "^\\cc$"
		},
		"skip": {
			"v3": "extract error: invalid regexp \"^\\\\cc$\": error parsing regexp: invalid escape sequence: `\\c`",
			"v3-roundtrip": "inital extract failed"
		},
		"tests": [
			{
				"description": "does not match",
				"data": "\\cc",
				"valid": false,
				"skip": {
					"v3": "could not extract schema",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "matches",
				"data": "\u0003",
				"valid": true,
				"skip": {
					"v3": "could not extract schema",
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 \\d matches ascii digits only",
		"schema": {
			"type": "string",
			"pattern": "^\\d$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ASCII zero matches",
				"data": "0",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "NKO DIGIT ZERO does not match (unlike e.g. Python)",
				"data": "߀",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "NKO DIGIT ZERO (as \\u escape) does not match",
				"data": "߀",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 \\D matches everything but ascii digits",
		"schema": {
			"type": "string",
			"pattern": "^\\D$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ASCII zero does not match",
				"data": "0",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "NKO DIGIT ZERO matches (unlike e.g. Python)",
				"data": "߀",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "NKO DIGIT ZERO (as \\u escape) matches",
				"data": "߀",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 \\w matches ascii letters only",
		"schema": {
			"type": "string",
			"pattern": "^\\w$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ASCII 'a' matches",
				"data": "a",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "latin-1 e-acute does not match (unlike e.g. Python)",
				"data": "é",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 \\W matches everything but ascii letters",
		"schema": {
			"type": "string",
			"pattern": "^\\W$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ASCII 'a' does not match",
				"data": "a",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "latin-1 e-acute matches (unlike e.g. Python)",
				"data": "é",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 \\s matches whitespace",
		"schema": {
			"type": "string",
			"pattern": "^\\s$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ASCII space matches",
				"data": " ",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Character tabulation matches",
				"data": "\t",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Line tabulation matches",
				"data": "\u000b",
				"valid": true,
				"skip": {
					"v3": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n    generated.cue:2:1\n    instance.json:1:1\n",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Form feed matches",
				"data": "\f",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "latin-1 non-breaking-space matches",
				"data": " ",
				"valid": true,
				"skip": {
					"v3": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n    generated.cue:2:1\n    instance.json:1:1\n",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "zero-width whitespace matches",
				"data": "\ufeff",
				"valid": true,
				"skip": {
					"v3": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n    generated.cue:2:1\n    instance.json:1:1\n",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "line feed matches (line terminator)",
				"data": "\n",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "paragraph separator matches (line terminator)",
				"data": "\u2029",
				"valid": true,
				"skip": {
					"v3": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n    generated.cue:2:1\n    instance.json:1:1\n",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "EM SPACE matches (Space_Separator)",
				"data": " ",
				"valid": true,
				"skip": {
					"v3": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n    generated.cue:2:1\n    instance.json:1:1\n",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Non-whitespace control does not match",
				"data": "\u0001",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Non-whitespace does not match",
				"data": "–",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ECMA 262 \\S matches everything but whitespace",
		"schema": {
			"type": "string",
			"pattern": "^\\S$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ASCII space does not match",
				"data": " ",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Character tabulation does not match",
				"data": "\t",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Line tabulation does not match",
				"data": "\u000b",
				"valid": false,
				"skip": {
					"v3": "unexpected success",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Form feed does not match",
				"data": "\f",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "latin-1 non-breaking-space does not match",
				"data": " ",
				"valid": false,
				"skip": {
					"v3": "unexpected success",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "zero-width whitespace does not match",
				"data": "\ufeff",
				"valid": false,
				"skip": {
					"v3": "unexpected success",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "line feed does not match (line terminator)",
				"data": "\n",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "paragraph separator does not match (line terminator)",
				"data": "\u2029",
				"valid": false,
				"skip": {
					"v3": "unexpected success",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "EM SPACE does not match (Space_Separator)",
				"data": " ",
				"valid": false,
				"skip": {
					"v3": "unexpected success",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Non-whitespace control matches",
				"data": "\u0001",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "Non-whitespace matches",
				"data": "–",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "patterns always use unicode semantics with pattern",
		"schema": {
			"pattern": "\\p{Letter}cole"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ascii character in json string",
				"data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "literal unicode character in json string",
				"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode character in hex format in string",
				"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode matching is case-sensitive",
				"data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters",
		"schema": {
			"pattern": "\\wcole"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ascii character in json string",
				"data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "literal unicode character in json string",
				"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode character in hex format in string",
				"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode matching is case-sensitive",
				"data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "pattern with ASCII ranges",
		"schema": {
			"pattern": "[a-z]cole"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "literal unicode character in json string",
				"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode character in hex format in string",
				"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "ascii characters match",
				"data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "\\d in pattern matches [0-9], not unicode digits",
		"schema": {
			"pattern": "^\\d+$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ascii digits",
				"data": "42",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "ascii non-digits",
				"data": "-%#",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)",
				"data": "৪২",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "pattern with non-ASCII digits",
		"schema": {
			"pattern": "^\\p{digit}+$"
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ascii digits",
				"data": "42",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "ascii non-digits",
				"data": "-%#",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)",
				"data": "৪২",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "patterns always use unicode semantics with patternProperties",
		"schema": {
			"type": "object",
			"patternProperties": {
				"\\p{Letter}cole": true
			},
			"additionalProperties": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ascii character in json string",
				"data": {
					"l'ecole": "pas de vraie vie"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "literal unicode character in json string",
				"data": {
					"l'école": "pas de vraie vie"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode character in hex format in string",
				"data": {
					"l'école": "pas de vraie vie"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode matching is case-sensitive",
				"data": {
					"L'ÉCOLE": "PAS DE VRAIE VIE"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters",
		"schema": {
			"type": "object",
			"patternProperties": {
				"\\wcole": true
			},
			"additionalProperties": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ascii character in json string",
				"data": {
					"l'ecole": "pas de vraie vie"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "literal unicode character in json string",
				"data": {
					"l'école": "pas de vraie vie"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode character in hex format in string",
				"data": {
					"l'école": "pas de vraie vie"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode matching is case-sensitive",
				"data": {
					"L'ÉCOLE": "PAS DE VRAIE VIE"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "patternProperties with ASCII ranges",
		"schema": {
			"type": "object",
			"patternProperties": {
				"[a-z]cole": true
			},
			"additionalProperties": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "literal unicode character in json string",
				"data": {
					"l'école": "pas de vraie vie"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "unicode character in hex format in string",
				"data": {
					"l'école": "pas de vraie vie"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "ascii characters match",
				"data": {
					"l'ecole": "pas de vraie vie"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "\\d in patternProperties matches [0-9], not unicode digits",
		"schema": {
			"type": "object",
			"patternProperties": {
				"^\\d+$": true
			},
			"additionalProperties": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ascii digits",
				"data": {
					"42": "life, the universe, and everything"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "ascii non-digits",
				"data": {
					"-%#": "spending the year dead for tax reasons"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)",
				"data": {
					"৪২": "khajit has wares if you have coin"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "patternProperties with non-ASCII digits",
		"schema": {
			"type": "object",
			"patternProperties": {
				"^\\p{digit}+$": true
			},
			"additionalProperties": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "ascii digits",
				"data": {
					"42": "life, the universe, and everything"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "ascii non-digits",
				"data": {
					"-%#": "spending the year dead for tax reasons"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)",
				"data": {
					"৪২": "khajit has wares if you have coin"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	}
]
