Crafter.Review/tests/Text/fixture/vectors.json
Jorijn van der Graaf 36852edf63
feat: the crafter-review skeleton, and its semantics for text, JSON and crypto
What the rest of crafter-review stands on.

- project.cpp: a static crafter.review-lib and the crafter-review
  executable; Crafter.Network without QUIC, pinned, or with --local from
  the checkout next to this one; Crafter.LintRules' lite rules, pinned;
  the version from CRAFTER_REVIEW_VERSION, git describe or 0.0.0-dev.
- :Core and :Driver: the version, PromptVersion 1, --version.
- :Json: nlohmann's ordered_json, which keeps key order and unknown keys,
  so the files every driver on a machine shares survive a rewrite; dumps
  in the indented file layout, the spaced one-line form and the compact
  sorted form the structured-output schema needs byte for byte.
- :Crypto: SHA-256/SHA-1/MD5, HMAC, PBKDF2 through libcrypto; base64 and
  base32 written out, because what they refuse, and with which message,
  is pinned.
- :Unicode, Unicode 16.0.0's tables: whitespace, line breaks, decimal
  digits, printable characters, case mappings and case-insensitive folds.
- :Text: string functions on code points, number parsing, the shortest
  float form and half-even rounding, printed values, shell patterns, URL
  splitting and unquoting, POSIX paths, universal newlines and the
  replacing UTF-8 decoder.

Tests: Crypto (published vectors), Text (293 reference vectors).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 05:29:18 +01:00

1865 lines
20 KiB
JSON

{
"unicode": "16.0.0",
"strip": [
[
"",
""
],
[
" ",
""
],
[
"a",
"a"
],
[
" a ",
"a"
],
[
"\ta b\n",
"a b"
],
[
"a\u00a0b",
"a\u00a0b"
],
[
"\u00a0x\u00a0",
"x"
],
[
"x\u2028y",
"x\u2028y"
],
[
"x\u001cy",
"x\u001cy"
],
[
"x\u0085y",
"x\u0085y"
],
[
"a\r\nb",
"a\r\nb"
],
[
"a\rb",
"a\rb"
],
[
"a\nb\n",
"a\nb"
],
[
"a\n\nb",
"a\n\nb"
],
[
"a\u000bb\fc",
"a\u000bb\fc"
],
[
"\u3000full\u3000width",
"full\u3000width"
],
[
"tail ",
"tail"
],
[
"\u00e9 \u00fc",
"\u00e9 \u00fc"
],
[
"\u200b zero width",
"\u200b zero width"
],
[
"one\u2029two",
"one\u2029two"
],
[
"line\n",
"line"
],
[
"\n",
""
],
[
"\r\n",
""
],
[
"a\u001db\u001ec",
"a\u001db\u001ec"
]
],
"split": [
[
"",
[]
],
[
" ",
[]
],
[
"a",
[
"a"
]
],
[
" a ",
[
"a"
]
],
[
"\ta b\n",
[
"a",
"b"
]
],
[
"a\u00a0b",
[
"a",
"b"
]
],
[
"\u00a0x\u00a0",
[
"x"
]
],
[
"x\u2028y",
[
"x",
"y"
]
],
[
"x\u001cy",
[
"x",
"y"
]
],
[
"x\u0085y",
[
"x",
"y"
]
],
[
"a\r\nb",
[
"a",
"b"
]
],
[
"a\rb",
[
"a",
"b"
]
],
[
"a\nb\n",
[
"a",
"b"
]
],
[
"a\n\nb",
[
"a",
"b"
]
],
[
"a\u000bb\fc",
[
"a",
"b",
"c"
]
],
[
"\u3000full\u3000width",
[
"full",
"width"
]
],
[
"tail ",
[
"tail"
]
],
[
"\u00e9 \u00fc",
[
"\u00e9",
"\u00fc"
]
],
[
"\u200b zero width",
[
"\u200b",
"zero",
"width"
]
],
[
"one\u2029two",
[
"one",
"two"
]
],
[
"line\n",
[
"line"
]
],
[
"\n",
[]
],
[
"\r\n",
[]
],
[
"a\u001db\u001ec",
[
"a",
"b",
"c"
]
]
],
"splitlines": [
[
"",
[]
],
[
" ",
[
" "
]
],
[
"a",
[
"a"
]
],
[
" a ",
[
" a "
]
],
[
"\ta b\n",
[
"\ta b"
]
],
[
"a\u00a0b",
[
"a\u00a0b"
]
],
[
"\u00a0x\u00a0",
[
"\u00a0x\u00a0"
]
],
[
"x\u2028y",
[
"x",
"y"
]
],
[
"x\u001cy",
[
"x",
"y"
]
],
[
"x\u0085y",
[
"x",
"y"
]
],
[
"a\r\nb",
[
"a",
"b"
]
],
[
"a\rb",
[
"a",
"b"
]
],
[
"a\nb\n",
[
"a",
"b"
]
],
[
"a\n\nb",
[
"a",
"",
"b"
]
],
[
"a\u000bb\fc",
[
"a",
"b",
"c"
]
],
[
"\u3000full\u3000width",
[
"\u3000full\u3000width"
]
],
[
"tail ",
[
"tail "
]
],
[
"\u00e9 \u00fc",
[
"\u00e9 \u00fc"
]
],
[
"\u200b zero width",
[
"\u200b zero width"
]
],
[
"one\u2029two",
[
"one",
"two"
]
],
[
"line\n",
[
"line"
]
],
[
"\n",
[
""
]
],
[
"\r\n",
[
""
]
],
[
"a\u001db\u001ec",
[
"a",
"b",
"c"
]
]
],
"splitlinesKeep": [
[
"",
[]
],
[
" ",
[
" "
]
],
[
"a",
[
"a"
]
],
[
" a ",
[
" a "
]
],
[
"\ta b\n",
[
"\ta b\n"
]
],
[
"a\u00a0b",
[
"a\u00a0b"
]
],
[
"\u00a0x\u00a0",
[
"\u00a0x\u00a0"
]
],
[
"x\u2028y",
[
"x\u2028",
"y"
]
],
[
"x\u001cy",
[
"x\u001c",
"y"
]
],
[
"x\u0085y",
[
"x\u0085",
"y"
]
],
[
"a\r\nb",
[
"a\r\n",
"b"
]
],
[
"a\rb",
[
"a\r",
"b"
]
],
[
"a\nb\n",
[
"a\n",
"b\n"
]
],
[
"a\n\nb",
[
"a\n",
"\n",
"b"
]
],
[
"a\u000bb\fc",
[
"a\u000b",
"b\f",
"c"
]
],
[
"\u3000full\u3000width",
[
"\u3000full\u3000width"
]
],
[
"tail ",
[
"tail "
]
],
[
"\u00e9 \u00fc",
[
"\u00e9 \u00fc"
]
],
[
"\u200b zero width",
[
"\u200b zero width"
]
],
[
"one\u2029two",
[
"one\u2029",
"two"
]
],
[
"line\n",
[
"line\n"
]
],
[
"\n",
[
"\n"
]
],
[
"\r\n",
[
"\r\n"
]
],
[
"a\u001db\u001ec",
[
"a\u001d",
"b\u001e",
"c"
]
]
],
"lower": [
[
"ABC",
"abc"
],
[
"abc",
"abc"
],
[
"\u00dcn\u00efc\u00f6d\u00e9",
"\u00fcn\u00efc\u00f6d\u00e9"
],
[
"\u0130stanbul",
"i\u0307stanbul"
],
[
"STRASSE",
"strasse"
],
[
"stra\u00dfe",
"stra\u00dfe"
],
[
"\u1e9e",
"\u00df"
],
[
"\u03a3\u0391",
"\u03c3\u03b1"
],
[
"\u212a",
"k"
],
[
"\u017f",
"\u017f"
],
[
"\u0131",
"\u0131"
],
[
"\u01c5",
"\u01c6"
],
[
"HTTP://Example.COM/Path",
"http://example.com/path"
],
[
"\ufb01",
"\ufb01"
],
[
"\ud801\udc00",
"\ud801\udc28"
]
],
"upper": [
[
"ABC",
"ABC"
],
[
"abc",
"ABC"
],
[
"\u00dcn\u00efc\u00f6d\u00e9",
"\u00dcN\u00cfC\u00d6D\u00c9"
],
[
"\u0130stanbul",
"\u0130STANBUL"
],
[
"STRASSE",
"STRASSE"
],
[
"stra\u00dfe",
"STRASSE"
],
[
"\u1e9e",
"\u1e9e"
],
[
"\u03a3\u0391",
"\u03a3\u0391"
],
[
"\u212a",
"\u212a"
],
[
"\u017f",
"S"
],
[
"\u0131",
"I"
],
[
"\u01c5",
"\u01c4"
],
[
"HTTP://Example.COM/Path",
"HTTP://EXAMPLE.COM/PATH"
],
[
"\ufb01",
"FI"
],
[
"\ud801\udc00",
"\ud801\udc00"
]
],
"floatRepr": [
[
0.0,
"0.0"
],
[
-0.0,
"-0.0"
],
[
1.0,
"1.0"
],
[
5.0,
"5.0"
],
[
0.1,
"0.1"
],
[
0.25,
"0.25"
],
[
1e-05,
"1e-05"
],
[
0.0001,
"0.0001"
],
[
1000000000000000.0,
"1000000000000000.0"
],
[
1e+16,
"1e+16"
],
[
123456789.0,
"123456789.0"
],
[
1.5e+300,
"1.5e+300"
],
[
2.675,
"2.675"
],
[
0.30000000000000004,
"0.30000000000000004"
],
[
1234.5678,
"1234.5678"
],
[
1e+22,
"1e+22"
],
[
1e+16,
"1e+16"
],
[
100.0,
"100.0"
],
[
0.5,
"0.5"
],
[
3.14159,
"3.14159"
],
[
1e-07,
"1e-07"
]
],
"round": [
[
2.675,
2,
"2.67"
],
[
0.125,
2,
"0.12"
],
[
0.375,
2,
"0.38"
],
[
2.5,
0,
"2"
],
[
3.5,
0,
"4"
],
[
0.205,
1,
"0.2"
],
[
12.3456,
1,
"12.3"
],
[
0.0049,
2,
"0.0"
],
[
7.0,
1,
"7.0"
],
[
-1.25,
1,
"-1.2"
],
[
1e+16,
1,
"1e+16"
],
[
0.15,
1,
"0.1"
],
[
0.25,
1,
"0.2"
],
[
0.35,
1,
"0.3"
]
],
"int": [
[
" 12 ",
12
],
[
"1_000",
1000
],
[
"+5",
5
],
[
"-0",
0
],
[
"0x10",
{
"error": "ValueError",
"message": "invalid literal for int() with base 10: '0x10'"
}
],
[
"\uff11\uff12",
12
],
[
"",
{
"error": "ValueError",
"message": "invalid literal for int() with base 10: ''"
}
],
[
"12.0",
{
"error": "ValueError",
"message": "invalid literal for int() with base 10: '12.0'"
}
],
[
"1__0",
{
"error": "ValueError",
"message": "invalid literal for int() with base 10: '1__0'"
}
],
[
"_1",
{
"error": "ValueError",
"message": "invalid literal for int() with base 10: '_1'"
}
],
[
"\u0663",
3
],
[
"999999999999999999",
999999999999999999
]
],
"float": [
[
" 2.5 ",
"2.5"
],
[
"inf",
"inf"
],
[
"-Infinity",
"-inf"
],
[
"nan",
"nan"
],
[
"1e3",
"1000.0"
],
[
"1_0.5",
"10.5"
],
[
".5",
"0.5"
],
[
"5.",
"5.0"
],
[
"",
{
"error": "ValueError",
"message": "could not convert string to float: ''"
}
],
[
"abc",
{
"error": "ValueError",
"message": "could not convert string to float: 'abc'"
}
],
[
"\u0661\u066b\u0665",
{
"error": "ValueError",
"message": "could not convert string to float: '\u0661\u066b\u0665'"
}
],
[
"1e400",
"inf"
]
],
"repr": [
[
"abc",
"'abc'"
],
[
"a'b",
"\"a'b\""
],
[
"a\"b",
"'a\"b'"
],
[
"a'b\"c",
"'a\\'b\"c'"
],
[
"\n\t\r",
"'\\n\\t\\r'"
],
[
"\u0000\u007f",
"'\\x00\\x7f'"
],
[
"\u00e9",
"'\u00e9'"
],
[
"\u2028",
"'\\u2028'"
],
[
"\ud83d\ude00",
"'\ud83d\ude00'"
],
[
"\\",
"'\\\\'"
],
[
"",
"''"
],
[
"\u009f",
"'\\x9f'"
],
[
"\u00a0",
"'\\xa0'"
],
[
"\ud7ff",
"'\\ud7ff'"
],
[
"\uffff",
"'\\uffff'"
]
],
"reprList": [
[
[
"a",
"b'c",
1,
null,
true,
2.5
],
"['a', \"b'c\", 1, None, True, 2.5]"
]
],
"reprDict": [
[
{
"x": 1,
"y": "two",
"z": [
1,
2
]
},
"{'x': 1, 'y': 'two', 'z': [1, 2]}"
]
],
"fnmatch": [
[
"src/a.test.ts",
"**/*.test.*",
true
],
[
"a.test.ts",
"**/*.test.*",
false
],
[
"docs/x/y.md",
"docs/**",
true
],
[
"README.md",
"*.md",
true
],
[
"dir/README.md",
"*.md",
true
],
[
"abc",
"[!a]*",
false
],
[
"bcd",
"[!a]*",
true
],
[
"a]",
"[]a]*",
true
],
[
"[x",
"[x",
true
],
[
"ab",
"a?",
true
],
[
"a/b",
"a?b",
true
],
[
"A.MD",
"*.md",
false
],
[
"x-y",
"[a-z]-[a-z]",
true
],
[
".hidden",
"*",
true
],
[
"a\\b",
"a\\b",
true
],
[
"a",
"[a-",
false
],
[
"tsconfig.app.json",
"tsconfig*.json",
true
],
[
"src/test/x.ts",
"src/test/**",
true
],
[
"review-gates",
"review-gates",
true
],
[
"a!b",
"a[!]b",
false
],
[
"^",
"[^]",
true
],
[
"a",
"[^a]",
true
],
[
"b",
"[^a]",
false
],
[
"\u00e9.md",
"*.md",
true
]
],
"urlsplit": [
[
"http://localhost:8080",
{
"scheme": "http",
"netloc": "localhost:8080",
"path": "",
"query": "",
"fragment": "",
"hostname": "localhost",
"username": null,
"password": null,
"port": 8080
}
],
[
"http://LOCALHOST:8080/",
{
"scheme": "http",
"netloc": "LOCALHOST:8080",
"path": "/",
"query": "",
"fragment": "",
"hostname": "localhost",
"username": null,
"password": null,
"port": 8080
}
],
[
"https://user:p%40ss@Example.COM:443/a?b=1#f",
{
"scheme": "https",
"netloc": "user:p%40ss@Example.COM:443",
"path": "/a",
"query": "b=1",
"fragment": "f",
"hostname": "example.com",
"username": "user",
"password": "p%40ss",
"port": 443
}
],
[
"postgresql://postgres:postgres@127.0.0.1:54322/postgres",
{
"scheme": "postgresql",
"netloc": "postgres:postgres@127.0.0.1:54322",
"path": "/postgres",
"query": "",
"fragment": "",
"hostname": "127.0.0.1",
"username": "postgres",
"password": "postgres",
"port": 54322
}
],
[
"postgres://[::1]:5432/db",
{
"scheme": "postgres",
"netloc": "[::1]:5432",
"path": "/db",
"query": "",
"fragment": "",
"hostname": "::1",
"username": null,
"password": null,
"port": 5432
}
],
[
"postgresql://u@localhost/",
{
"scheme": "postgresql",
"netloc": "u@localhost",
"path": "/",
"query": "",
"fragment": "",
"hostname": "localhost",
"username": "u",
"password": null,
"port": null
}
],
[
"http://h:0/",
{
"scheme": "http",
"netloc": "h:0",
"path": "/",
"query": "",
"fragment": "",
"hostname": "h",
"username": null,
"password": null,
"port": 0
}
],
[
"http://h:99999/",
{
"scheme": "http",
"netloc": "h:99999",
"path": "/",
"query": "",
"fragment": "",
"hostname": "h",
"username": null,
"password": null,
"port": {
"error": "ValueError",
"message": "Port out of range 0-65535"
}
}
],
[
"http://h:x/",
{
"scheme": "http",
"netloc": "h:x",
"path": "/",
"query": "",
"fragment": "",
"hostname": "h",
"username": null,
"password": null,
"port": {
"error": "ValueError",
"message": "Port could not be cast to integer value as 'x'"
}
}
],
[
"http://[::1",
{
"error": "ValueError",
"message": "Invalid IPv6 URL"
}
],
[
"//netloc/path",
{
"scheme": "",
"netloc": "netloc",
"path": "/path",
"query": "",
"fragment": "",
"hostname": "netloc",
"username": null,
"password": null,
"port": null
}
],
[
"mailto:x@y",
{
"scheme": "mailto",
"netloc": "",
"path": "x@y",
"query": "",
"fragment": "",
"hostname": null,
"username": null,
"password": null,
"port": null
}
],
[
"http://h/p;params?q",
{
"scheme": "http",
"netloc": "h",
"path": "/p;params",
"query": "q",
"fragment": "",
"hostname": "h",
"username": null,
"password": null,
"port": null
}
],
[
" http://h/\tp\n",
{
"scheme": "http",
"netloc": "h",
"path": "/p",
"query": "",
"fragment": "",
"hostname": "h",
"username": null,
"password": null,
"port": null
}
],
[
"HTTP://h",
{
"scheme": "http",
"netloc": "h",
"path": "",
"query": "",
"fragment": "",
"hostname": "h",
"username": null,
"password": null,
"port": null
}
],
[
"h:8080",
{
"scheme": "h",
"netloc": "",
"path": "8080",
"query": "",
"fragment": "",
"hostname": null,
"username": null,
"password": null,
"port": null
}
],
[
"http://h:/",
{
"scheme": "http",
"netloc": "h:",
"path": "/",
"query": "",
"fragment": "",
"hostname": "h",
"username": null,
"password": null,
"port": null
}
],
[
"postgresql://%75ser:pa%3Ass@host/d%62",
{
"scheme": "postgresql",
"netloc": "%75ser:pa%3Ass@host",
"path": "/d%62",
"query": "",
"fragment": "",
"hostname": "host",
"username": "%75ser",
"password": "pa%3Ass",
"port": null
}
],
[
"http://[v1.fe]/",
{
"scheme": "http",
"netloc": "[v1.fe]",
"path": "/",
"query": "",
"fragment": "",
"hostname": "v1.fe",
"username": null,
"password": null,
"port": null
}
],
[
"http://a@b@c/",
{
"scheme": "http",
"netloc": "a@b@c",
"path": "/",
"query": "",
"fragment": "",
"hostname": "c",
"username": "a@b",
"password": null,
"port": null
}
]
],
"unquote": [
[
"a%20b",
"a b"
],
[
"%E2%9C%93",
"\u2713"
],
[
"%zz",
"%zz"
],
[
"%",
"%"
],
[
"100%25",
"100%"
],
[
"p%40ss",
"p@ss"
],
[
"%C3%28",
"\ufffd("
],
[
"+",
"+"
]
],
"natural": [
[
"slot 10",
[
"slot ",
10,
""
]
],
[
"slot 2",
[
"slot ",
2,
""
]
],
[
"a1b2",
[
"a",
1,
"b",
2,
""
]
],
[
"10",
[
"",
10,
""
]
],
[
"",
[
""
]
],
[
"x",
[
"x"
]
],
[
"\u00e99",
[
"\u00e9",
9,
""
]
],
[
"v2.10",
[
"v",
2,
".",
10,
""
]
]
],
"paths": [
[
[
"normpath",
"a//b/./c/.."
],
"a/b"
],
[
[
"normpath",
"/../x"
],
"/x"
],
[
[
"normpath",
""
],
"."
],
[
[
"normpath",
"//a"
],
"//a"
],
[
[
"normpath",
"///a"
],
"/a"
],
[
[
"normpath",
"a/"
],
"a"
],
[
[
"relpath",
"/a/b/c",
"/a"
],
"b/c"
],
[
[
"relpath",
"/a",
"/a/b/c"
],
"../.."
],
[
[
"relpath",
"/a/b",
"/a/b"
],
"."
],
[
[
"relpath",
"/x/y",
"/a/b"
],
"../../x/y"
],
[
[
"abspath",
"/a/b/../c"
],
"/a/c"
],
[
[
"basename",
"/a/b/"
],
""
],
[
[
"basename",
"a.patch"
],
"a.patch"
],
[
[
"dirname",
"/a/b/c"
],
"/a/b"
],
[
[
"dirname",
"a"
],
""
],
[
[
"join",
"/a",
"b"
],
"/a/b"
],
[
[
"join",
"/a",
"/b"
],
"/b"
],
[
[
"join",
"a/",
"b"
],
"a/b"
]
],
"jsonIndent1": [
[
{
"version": 1,
"drivers": {},
"seats": {
"a": {
"windows": {
"five_hour": {
"utilization": 39,
"resetsAt": 1793421000
}
},
"pauseUntil": 0.0,
"state": null,
"inflight": {}
}
}
},
"{\n \"version\": 1,\n \"drivers\": {},\n \"seats\": {\n \"a\": {\n \"windows\": {\n \"five_hour\": {\n \"utilization\": 39,\n \"resetsAt\": 1793421000\n }\n },\n \"pauseUntil\": 0.0,\n \"state\": null,\n \"inflight\": {}\n }\n }\n}"
],
[
[
1,
2.5,
"x",
true,
null,
[],
{}
],
"[\n 1,\n 2.5,\n \"x\",\n true,\n null,\n [],\n {}\n]"
],
[
{
"\u00e9": "\u00fc\u2028\u0000",
"emoji": "\ud83d\ude00"
},
"{\n \"\\u00e9\": \"\\u00fc\\u2028\\u0000\",\n \"emoji\": \"\\ud83d\\ude00\"\n}"
],
[
{
"float": 1792966830.0,
"small": 1e-07,
"neg": -0.0
},
"{\n \"float\": 1792966830.0,\n \"small\": 1e-07,\n \"neg\": -0.0\n}"
]
],
"jsonDefault": [
[
{
"version": 1,
"drivers": {},
"seats": {
"a": {
"windows": {
"five_hour": {
"utilization": 39,
"resetsAt": 1793421000
}
},
"pauseUntil": 0.0,
"state": null,
"inflight": {}
}
}
},
"{\"version\": 1, \"drivers\": {}, \"seats\": {\"a\": {\"windows\": {\"five_hour\": {\"utilization\": 39, \"resetsAt\": 1793421000}}, \"pauseUntil\": 0.0, \"state\": null, \"inflight\": {}}}}"
],
[
[
1,
2.5,
"x",
true,
null,
[],
{}
],
"[1, 2.5, \"x\", true, null, [], {}]"
],
[
{
"\u00e9": "\u00fc\u2028\u0000",
"emoji": "\ud83d\ude00"
},
"{\"\\u00e9\": \"\\u00fc\\u2028\\u0000\", \"emoji\": \"\\ud83d\\ude00\"}"
],
[
{
"float": 1792966830.0,
"small": 1e-07,
"neg": -0.0
},
"{\"float\": 1792966830.0, \"small\": 1e-07, \"neg\": -0.0}"
]
],
"jsonSorted": [
[
{
"version": 1,
"drivers": {},
"seats": {
"a": {
"windows": {
"five_hour": {
"utilization": 39,
"resetsAt": 1793421000
}
},
"pauseUntil": 0.0,
"state": null,
"inflight": {}
}
}
},
"{\"drivers\":{},\"seats\":{\"a\":{\"inflight\":{},\"pauseUntil\":0.0,\"state\":null,\"windows\":{\"five_hour\":{\"resetsAt\":1793421000,\"utilization\":39}}}},\"version\":1}"
],
[
[
1,
2.5,
"x",
true,
null,
[],
{}
],
"[1,2.5,\"x\",true,null,[],{}]"
],
[
{
"\u00e9": "\u00fc\u2028\u0000",
"emoji": "\ud83d\ude00"
},
"{\"emoji\":\"\\ud83d\\ude00\",\"\\u00e9\":\"\\u00fc\\u2028\\u0000\"}"
],
[
{
"float": 1792966830.0,
"small": 1e-07,
"neg": -0.0
},
"{\"float\":1792966830.0,\"neg\":-0.0,\"small\":1e-07}"
]
],
"jsonDuplicate": [
[
"{\"a\": 1, \"b\": 2, \"a\": 3}",
[
[
"a",
3
],
[
"b",
2
]
]
]
]
}