Skip to content

Instantly share code, notes, and snippets.

@leplatrem
Last active August 14, 2020 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leplatrem/58d428dae53603843659226348937aff to your computer and use it in GitHub Desktop.
Save leplatrem/58d428dae53603843659226348937aff to your computer and use it in GitHub Desktop.
➜ canonicaljson-spec git:(gh-pages) ./test.sh ../canonicaljson-rs/demo/target/debug/demo
malformed/empty OK
malformed/hex_number OK
malformed/invalid_string_character OK
malformed/invalid_string_escape OK
malformed/invalid_string_unicode_escape OK
malformed/leading_plus_number OK
malformed/leading_zero_number OK
malformed/missing_array_element OK
malformed/missing_integer_number OK
malformed/missing_object_colon OK
malformed/missing_object_element OK
malformed/partial_fraction_number OK
malformed/unclosed_array OK
malformed/unclosed_object OK
malformed/unclosed_string OK
malformed/unopened_array OK
malformed/unopened_object OK
malformed/unopened_string OK
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("lone leading surrogate in hex escape", line: 4, column: 8)', src/main.rs:17:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Files - and ./test/tokens/3.object-ordering/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.833736982 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.853737004 +0200
@@ -1 +1,78 @@
-
+{
+ "": "empty",
+ "\u0000": "U+0000 NULL",
+ "\u0001": "U+0001 START OF HEADING",
+ "\t": "U+0009 CHARACTER TABULATION",
+ "\u001F": "U+001F INFORMATION SEPARATOR ONE",
+ " ": "U+0020 SPACE",
+ "\"": "U+0022 QUOTATION MARK",
+ "A": "U+0041 LATIN CAPITAL LETTER A",
+ "Å": "composition—U+0041 LATIN CAPITAL LETTER A + U+030A COMBINING RING ABOVE",
+ "\\": "U+005C REVERSE SOLIDUS",
+ "deep": [
+ "...",
+ "filler",
+ "...",
+ {
+ "": "empty",
+ "\u0000": "U+0000 NULL",
+ "\u0001": "U+0001 START OF HEADING",
+ "\t": "U+0009 CHARACTER TABULATION",
+ "\u001F": "U+001F INFORMATION SEPARATOR ONE",
+ " ": "U+0020 SPACE",
+ "\"": "U+0022 QUOTATION MARK",
+ "A": "U+0041 LATIN CAPITAL LETTER A",
+ "Å": "composition—U+0041 LATIN CAPITAL LETTER A + U+030A COMBINING RING ABOVE",
+ "\\": "U+005C REVERSE SOLIDUS",
+ "deep": "…",
+ "é̂": "composition—U+0065 LATIN SMALL LETTER E + U+0301 COMBINING ACUTE ACCENT + U+0302 COMBINING CIRCUMFLEX ACCENT",
+ "ế": "composition—U+0065 LATIN SMALL LETTER E + U+0302 COMBINING CIRCUMFLEX ACCENT + U+0301 COMBINING ACUTE ACCENT",
+ "": "U+007F DELETE",
+ "": "U+0080 PADDING CHARACTER",
+ "Å": "U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE",
+ "ế": "composition—U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX + U+0301 COMBINING ACUTE ACCENT",
+ "́": "U+0301 COMBINING ACUTE ACCENT",
+ "̂": "U+0302 COMBINING CIRCUMFLEX ACCENT",
+ "̇": "U+0307 COMBINING DOT ABOVE",
+ "̊": "U+030A COMBINING RING ABOVE",
+ "ế": "U+1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE",
+ "Å": "U+212B ANGSTROM SIGN",
+ "←": "U+2190 LEFTWARDS ARROW",
+ "\uD800": "U+D800 lowest high surrogate",
+ "\uD800\uDBFF": "two high surrogates",
+ "\uDBFF": "U+DBFF highest high surrogate",
+ "\uDC00": "U+DC00 lowest low surrogate",
+ "\uDC00\uDBFF": "surrogates—low + high",
+ "\uDC00\uDFFF": "two low surrogates",
+ "\uDFFF": "U+DFFF highest high surrogate",
+ "fi": "U+FB01 LATIN SMALL LIGATURE FI",
+ "�": "U+FFFD REPLACEMENT CHARACTER",
+ "𐀀": "U+10000 LINEAR B SYLLABLE B008 A",
+ "𝌆": "surrogate pair—U+1D306 TETRAGRAM FOR CENTRE"
+ }
+ ],
+ "é̂": "composition—U+0065 LATIN SMALL LETTER E + U+0301 COMBINING ACUTE ACCENT + U+0302 COMBINING CIRCUMFLEX ACCENT",
+ "ế": "composition—U+0065 LATIN SMALL LETTER E + U+0302 COMBINING CIRCUMFLEX ACCENT + U+0301 COMBINING ACUTE ACCENT",
+ "": "U+007F DELETE",
+ "": "U+0080 PADDING CHARACTER",
+ "Å": "U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE",
+ "ế": "composition—U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX + U+0301 COMBINING ACUTE ACCENT",
+ "́": "U+0301 COMBINING ACUTE ACCENT",
+ "̂": "U+0302 COMBINING CIRCUMFLEX ACCENT",
+ "̇": "U+0307 COMBINING DOT ABOVE",
+ "̊": "U+030A COMBINING RING ABOVE",
+ "ế": "U+1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE",
+ "Å": "U+212B ANGSTROM SIGN",
+ "←": "U+2190 LEFTWARDS ARROW",
+ "\uD800": "U+D800 lowest high surrogate",
+ "\uD800\uDBFF": "two high surrogates",
+ "\uDBFF": "U+DBFF highest high surrogate",
+ "\uDC00": "U+DC00 lowest low surrogate",
+ "\uDC00\uDBFF": "surrogates—low + high",
+ "\uDC00\uDFFF": "two low surrogates",
+ "\uDFFF": "U+DFFF highest high surrogate",
+ "fi": "U+FB01 LATIN SMALL LIGATURE FI",
+ "�": "U+FFFD REPLACEMENT CHARACTER",
+ "𐀀": "U+10000 LINEAR B SYLLABLE B008 A",
+ "𝌆": "surrogate pair—U+1D306 TETRAGRAM FOR CENTRE"
+}
tokens/4.integer/1.no-negative-zero OK
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("number out of range", line: 12, column: 316)', src/main.rs:17:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Files - and ./test/tokens/4.integer/2.no-decimal-point/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.865737017 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.865737017 +0200
@@ -1 +1,24 @@
-
+[
+ 0,
+ 0,
+ 4,
+ 4,
+ 42,
+ 42,
+ 42,
+ 42,
+ 8,
+ 8,
+ 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217,
+ 0,
+ 0,
+ -4,
+ -4,
+ -42,
+ -42,
+ -42,
+ -42,
+ -8,
+ -8,
+ -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217
+]
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("number out of range", line: 35, column: 312)', src/main.rs:17:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Files - and ./test/tokens/4.integer/3.no-exponent/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.869737022 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.877737030 +0200
@@ -1 +1,74 @@
-
+[
+ "2^8 +/- 1",
+ 255,
+ 256,
+ 257,
+ "2^16 +/- 1",
+ 65535,
+ 65536,
+ 65537,
+ "2^32 +/- 1",
+ 4294967295,
+ 4294967296,
+ 4294967297,
+ "2^53 +/- 1",
+ 9007199254740991,
+ 9007199254740992,
+ 9007199254740993,
+ "2^64 +/- 1",
+ 18446744073709551615,
+ 18446744073709551616,
+ 18446744073709551617,
+ "2^128 +/- 1",
+ 340282366920938463463374607431768211455,
+ 340282366920938463463374607431768211456,
+ 340282366920938463463374607431768211457,
+ "2^256 +/- 1",
+ 115792089237316195423570985008687907853269984665640564039457584007913129639935,
+ 115792089237316195423570985008687907853269984665640564039457584007913129639936,
+ 115792089237316195423570985008687907853269984665640564039457584007913129639937,
+ "10^100 +/- 1",
+ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+ 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,
+ 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,
+ "2^1024 +/- 1",
+ 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215,
+ 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216,
+ 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217,
+ "-2^8 +/- 1",
+ -255,
+ -256,
+ -257,
+ "-2^16 +/- 1",
+ -65535,
+ -65536,
+ -65537,
+ "-2^32 +/- 1",
+ -4294967295,
+ -4294967296,
+ -4294967297,
+ "-2^53 +/- 1",
+ -9007199254740991,
+ -9007199254740992,
+ -9007199254740993,
+ "-2^64 +/- 1",
+ -18446744073709551615,
+ -18446744073709551616,
+ -18446744073709551617,
+ "-2^128 +/- 1",
+ -340282366920938463463374607431768211455,
+ -340282366920938463463374607431768211456,
+ -340282366920938463463374607431768211457,
+ "-2^256 +/- 1",
+ -115792089237316195423570985008687907853269984665640564039457584007913129639935,
+ -115792089237316195423570985008687907853269984665640564039457584007913129639936,
+ -115792089237316195423570985008687907853269984665640564039457584007913129639937,
+ "-10^100 +/- 1",
+ -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+ -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,
+ -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,
+ "-2^1024 +/- 1",
+ -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215,
+ -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216,
+ -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217
+]
Files - and ./test/tokens/5.non-integer/1.single-digit-nonzero-significand-integer/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.881737035 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.885737039 +0200
@@ -1,16 +1,16 @@
[
- 3.14,
- 3.14,
- 3.14,
- 3.14,
- 0.011,
- 1.797693134862316e+307,
- 1.797693134862316e+307,
- -3.14,
- -3.14,
- -3.14,
- -3.14,
- -0.011,
- -17976931348623160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,
- -17976931348623160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+ 3.14E0,
+ 3.14E0,
+ 3.14E0,
+ 3.14E0,
+ 1.1E-2,
+ 1.79769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217E307,
+ 1.79769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217E307,
+ -3.14E0,
+ -3.14E0,
+ -3.14E0,
+ -3.14E0,
+ -1.1E-2,
+ -1.79769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217E307,
+ -1.79769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217E307
]
Files - and ./test/tokens/5.non-integer/2.nonempty-significand-fraction/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.889737043 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.893737048 +0200
@@ -1,6 +1,6 @@
[
- 0,
- 9.9e-100,
- 0,
- -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099
+ 1.0E-1000,
+ 9.900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099E-100,
+ -1.0E-1000,
+ -9.900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099E-100
]
Files - and ./test/tokens/5.non-integer/3.no-significand-fraction-trailing-zeroes/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.897737052 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.901737056 +0200
@@ -1,12 +1,12 @@
[
- 1.4,
- 1.4,
- 1.4,
- 1.4,
- 0.0005,
- -1.4,
- -1.4,
- -1.4,
- -1.4,
- -0.0005
+ 1.4E0,
+ 1.4E0,
+ 1.4E0,
+ 1.4E0,
+ 5.0E-4,
+ -1.4E0,
+ -1.4E0,
+ -1.4E0,
+ -1.4E0,
+ -5.0E-4
]
Files - and ./test/tokens/5.non-integer/4.capital-E/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.905737061 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.909737065 +0200
@@ -1,12 +1,12 @@
[
- 0.01,
- 0.1,
- 1e-100,
- 1.0000000000000001e-98,
- 1e-100,
- -0.01,
- -0.1,
- -0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,
- -0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001,
- -0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+ 1.0E-2,
+ 1.0E-1,
+ 1.0E-100,
+ 1.0E-98,
+ 1.0E-100,
+ -1.0E-2,
+ -1.0E-1,
+ -1.0E-100,
+ -1.0E-98,
+ -1.0E-100
]
Files - and ./test/tokens/5.non-integer/5.no-exponent-plus/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.913737069 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.913737069 +0200
@@ -1,6 +1,6 @@
[
- 5.5,
- 550000.05,
- -5.5,
- -550000.05
+ 5.5E0,
+ 5.5000005E5,
+ -5.5E0,
+ -5.5000005E5
]
Files - and ./test/tokens/5.non-integer/6.no-exponent-leading-zeroes/expected.json differ
--- 0xmNZUGz.test-tokens.sh/output.pretty.json 2020-08-14 18:14:19.921737078 +0200
+++ 0xmNZUGz.test-tokens.sh/expected.pretty.json 2020-08-14 18:14:19.921737078 +0200
@@ -1,8 +1,8 @@
[
- 5.6,
- 5600000.06,
- 0,
- -5.6,
- -5600000.06,
- 0
+ 5.6E0,
+ 5.60000006E6,
+ 5.6E-1000,
+ -5.6E0,
+ -5.60000006E6,
+ -5.6E-1000
]
Files - and ./test/tokens/6.string/1.no-unnecessary-escapes/expected.json differ
Non-token input after 896 characters: "\u6} surrogate pair\u2014U+1D306
whitespace/array OK
whitespace/false OK
whitespace/null OK
whitespace/number OK
whitespace/object OK
whitespace/string OK
whitespace/true OK
FAIL: ../canonicaljson-rs/demo/target/debug/demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment