“³ EmacsMode±-*- preserves -*-„…“³ Documentationµ±?Individual test cases may be any of the following record types:“³ TestCaseTypes·³Test·³fieldsµ³binary³annotatedValue„³ expectations¶°°°°°°°°„„³ParseEOF·³fieldsµ³text„³ expectations¶°„„³ DecodeEOF·³fieldsµ³bytes„³ expectations¶° „„³ ParseError·³fieldsµ³text„³ expectations¶°„„³ ParseShort·³fieldsµ³text„³ expectations¶°„„³ DecodeError·³fieldsµ³bytes„³ expectations¶°„„³ DecodeShort·³fieldsµ³bytes„³ expectations¶°„„³NondeterministicTest·³fieldsµ³binary³annotatedValue„³ expectations¶°°°°°°°„„„„±3In each test, let stripped = strip(annotatedValue),±Q encodeBinary(Ā·) produce canonical ordering and no annotations,±S looseEncodeBinary(Ā·) produce any ordering, but with annotations,±] annotatedBinary(Ā·) produce ā€œcanonical orderingā€, but with annotations,±7 decodeBinary(Ā·) include annotations,±5 encodeText(Ā·) include annotations,±5 decodeText(Ā·) include annotations,±Kand check the following numbered expectations according to the table above:“³TestCaseExpectations·°±6decodeBinary(encodeBinary(annotatedValue))) = stripped°±&strip(decodeBinary(binary)) = stripped°±%decodeBinary(binary) = annotatedValue°±>decodeBinary(annotatedBinary(annotatedValue)) = annotatedValue°±+decodeText(encodeText(stripped)) = stripped°±7decodeText(encodeText(annotatedValue)) = annotatedValue°±(annotatedBinary(annotatedValue) = binary°±*looseEncodeBinary(annotatedValue) = binary°±?decodeText(text) fails with a syntax error (NB. never with EOF)°±cdecodeText(text) fails signalling premature EOF after partial parse (NB. never with a syntax error)°±OdecodeText(text) fails signalling immediate EOF (NB. never with a syntax error)°±BdecodeBinary(bytes) fails with a syntax error (NB. never with EOF)°±fdecodeBinary(bytes) fails signalling premature EOF after partial parse (NB. never with a syntax error)° ±RdecodeBinary(bytes) fails signalling immediate EOF (NB. never with a syntax error)„„±RImplementations may vary in their treatment of the difference between expectations±N21/22 and 31/32, depending on how they wish to treat end-of-stream conditions.±[The idea of canonical-ordering-with-annotations is to encode, say, sets with their elements±Tin sorted order of their canonical annotationless binary encoding, but then actually±**serialized* with the annotations present.„„“³ TestCases·³int0“³Test²°°„³int1“³Test²°°„³set0“³Test²¶„¶„„³set1“³NondeterministicTest² ¶°°°„¶°°°„„³set2…±Missing close brace“³ ParseShort± #{ 1 2 3 „³set3…±Duplicate value“³ ParseError±#{a a}„³tag0…±Unexpected end tag“³ DecodeError²„„³tag1…± Invalid tag“³ DecodeError²„³tag2…± Invalid tag“³ DecodeError²a±„³dict0“³Test²·„·„„³dict1“³NondeterministicTest²I·±b³a°µ°°°„²c·³ first-name± Elizabeth„·³surname± Blackwell„„·±b³a°µ°°°„²c·³ first-name± Elizabeth„·³surname± Blackwell„„„³dict2…±Missing close brace“³ ParseShort± { a: b, c: d „³dict3…± Duplicate key“³ ParseError±{ a: 1, a: 2 }„³dict4…±Unexpected close brace“³ ParseError±}„³dict5…± Missing value“³ DecodeError² ·°°°„„³dict6…±'Comma not allowed between key and colon“³ ParseError±{ a,: 1, b: 2 }„³dict7…±)Comma not allowed between colon and value“³ ParseError±{ a:, 1, b: 2 }„³dict8“³NondeterministicTest²·³a°³b°„·³a°³b°„„³int+0“³Test²°°„³int-0“³Test²°°„³int-1“³Test²°’°’„³int-2“³Test²°ž°ž„³int-3“³Test²°ż°ż„³int-4“³Test²°ü°ü„³int12“³Test²° ° „³int13“³Test²° ° „³list0“³Test²µ„µ„„³list4“³Test²µ°°°°„µ°°°°„„³list5“³Test² µ°ž°’°°„µ°ž°’°°„„³list6“³Test²µ±hello³there²worldµ„¶„€„µ±hello³there²worldµ„¶„€„„³list7“³Test²µ³abc³...³def„µ³abc³...³def„„³list8…±Missing close bracket“³ ParseShort±[„³list9…±Unexpected close bracket“³ ParseError±]„³set2a…±Missing close brace“³ ParseShort±#{„³set3a…±Duplicate value“³ DecodeError²¶°°„„³bytes2“³Test²²hello²hello„³bytes3“³Test²²ABC²ABC„³bytes4“³Test²²ABC²ABC„³bytes5“³Test²²AJN²AJN„³bytes6…±Bytes must be 2-digits entire“³ ParseError± #x"414 243"„³bytes7“³Test²²corymb²corymb„³bytes8“³Test²²corymb²corymb„³bytes9“³Test²²Hi²Hi„³dict2a…±Missing close brace“³ ParseShort±{„³dict3a…± Duplicate key“³ DecodeError²·°°°°„„³embed0“³Test²†°†°„³embed1“³Test²††°††°„³embed2“³Test² µ†°†±hello„µ†°†±hello„„³int127“³Test²°°„³int128“³Test²°€°€„³int255“³Test²°’°’„³int256“³Test²°°„³list10…±Missing end byte“³ DecodeShort²µ€€„³list11“³Test²µ°„µ°„„³list12“³Test²µ° „µ° „„³list4a“³Test²µ°°°°„µ°°°°„„³list4b“³Test²µ°°°°„µ°°°°„„³bytes10“³Test²²Hi²Hi„³bytes11“³Test²²Hi²Hi„³bytes12…±%Bytes syntax only supports \x, not \u“³ ParseError± #"\u6c34"„³bytes13“³Test²²abcl4š\/" xyz²abcl4š\/" xyz„³bytes2a“³Test…±4Internal whitespace is allowed, not including commas²²hello²hello„³bytes2b…±'Commas forbidden in internal whitespace“³ ParseError±#x"B2, 05, 68, 65, 6c, 6c, 6f"„³double0“³Test² ‡‡„³double1“³Test² ‡?š‡?š„³double2“³Test² ‡ž<··Yæ&‡ž<··Yæ&„³double3“³Test² ‡4Vxš¼Žš‡4Vxš¼Žš„³double4…±Fewer than 16 digits“³ ParseError± #xd"12345678"„³double5…±More than 16 digits“³ ParseError±#xd"123456789abcdef012"„³double6…± Invalid chars“³ ParseError±#xd"12zz56789abcdef0"„³double7…±Positive infinity“³Test² ‡š‡š„³double8…±Negative infinity“³Test² ‡’š‡’š„³double9…±-qNaN“³Test² ‡’š‡’š„³int+127“³Test²°°„³int-127“³Test²°°„³int-128“³Test²°€°€„³int-129“³Test²°’°’„³int-254“³Test²°’°’„³int-255“³Test²°’°’„³int-256“³Test²°’°’„³int-257“³Test²°ž’°ž’„³record1“³Test²“³capture“³discard„„“³capture“³discard„„„³record2“³Test²5“³observe“³speak“³discard„“³capture“³discard„„„„“³observe“³speak“³discard„“³capture“³discard„„„„„³record3“³Test²E“µ³titled³person°³thing°„°e± Blackwell“³date°°°„±Dr„“µ³titled³person°³thing°„°e± Blackwell“³date°°°„±Dr„„³record4“³Test² “³discard„“³discard„„³record5“³Test²“°µ„„“°µ„„„³record6“³Test²“³discard³surprise„“³discard³surprise„„³record7“³Test²“±aString°°„“±aString°°„„³record8“³Test²““³discard„°°„““³discard„°°„„³record9…±Missing record label“³ ParseError±<>„³string0“³Test²±±„³string3“³Test²±hello±hello„³string4“³Test²±abcę°“ę°“\/" xyz±abcę°“ę°“\/" xyz„³string5“³Test²±š„ž±š„ž„³string6…±Short unicode escape“³ ParseError±"\u6c"„³string7…±Short unicode escape“³ ParseError±"\u6c3"„³symbol0“³Test²³³„³symbol1“³Test²³ab ab³ab ab„³symbol2“³Test²³hello³hello„³symbol3“³Test²³1-2-3³1-2-3„³symbol4“³Test²³a-b-c³a-b-c„³symbol5“³Test²³a+b+c³a+b+c„³symbol6“³Test²³+³+„³symbol7“³Test²³+++³+++„³symbol8“³Test²³-³-„³symbol9“³Test²³---³---„³double+0“³Test² ‡‡„³double-0“³Test² ‡€‡€„³double10…±-qNaN“³Test² ‡’š‡’š„³double11…±+qNaN“³Test² ‡š‡š„³double12…±+qNaN“³Test² ‡š‡š„³double13…± Bad spacing“³ ParseError±#xd"12345 6789abcdef0"„³double14…±-sNaN“³Test² ‡’ų‡’ų„³double15…±-sNaN“³Test² ‡’ų‡’ų„³double16…±+sNaN“³Test² ‡ų‡ų„³double17…±+sNaN“³Test² ‡ų‡ų„³double1a“³Test² ‡?š‡?š„³double1b“³Test² ‡?š‡?š„³double1c“³Test² ‡?š‡?š„³double1d“³Test² ‡?š‡?š„³double1e“³Test² ‡?š‡?š„³double1f“³Test² ‡?š‡?š„³int32767“³Test²°’°’„³int32768“³Test²°€°€„³int65535“³Test²°’’°’’„³int65536“³Test²°°„³noinput0…±No input at all“³ DecodeEOF²„³record10…±Missing close-angle-bracket“³ ParseShort±<„³record11…±Unexpected close-angle-bracket“³ ParseError±>„³record2a…±Commas not allowed in records“³ ParseError±0, >>>„³symbol10“³Test²³-a³-a„³symbol11“³Test²³---a³---a„³symbol12“³Test²³---1³---1„³symbol13“³Test²³+1.x³+1.x„³symbol14“³Test²³š„ž³š„ž„³symbol15…±A 130-byte symbol“³Test²…³‚aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa³‚aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa„³ int131072“³Test²°°„³ longlist14“³Test²µ€€€€€€€€€€€€€€„µ€€€€€€€€€€€€€€„„³ longlist15“³Test²µ€€€€€€€€€€€€€€€„µ€€€€€€€€€€€€€€€„„³ annotation1“³Test² …±abc° …±abc° „³ annotation2“³Test²…±abc…±defµµ„…±xµ„„…±abc…±defµµ„…±xµ„„„³ annotation3“³Test²……°°……°°°……°°……°°°„³ annotation4“³NondeterministicTest²"·…³ak³a…³av°…³bk³b…³bv°„·…³ak³a…³av°…³bk³b…³bv°„„³ annotation5“³Test²…³ar“³R…³af³f„…³ar“³R…³af³f„„³ annotation6“³Test²“…³ar³R…³af³f„“…³ar³R…³af³f„„³ annotation7…±EStop reading symbols at @ -- this test has three separate annotations“³Test²…³a…³b…³cµ„…³a…³b…³cµ„„³ annotation8…±)Commas forbidden between @ and annotation“³ ParseError±@,a b„³ annotation9…±2Commas forbidden between annotation and underlying“³ ParseError±@a, b„³ delimiters0“³Test²µ€€„µ€€„„³ delimiters1…±%Note no space between the falses here“³Test²µ€€„µ€€„„³ delimiters2“³Test²µ€³foo„µ€³foo„„³ delimiters3…±#No space between the #f and the foo“³ ParseError±[#ffoo]„³ delimiters4…±Note no space after the #f“³Test²µ€…±a line comment„µ€…±a line comment„„³ delimiters5…±Note no space after the #f“³Test² µ€…³ann„µ€…³ann„„³ longlist100“³Test²fµ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€„µ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€„„³ longlist200“³Test²Źµ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€„µ€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€„„³ whitespace0…±1Leading spaces have to eventually yield something“³ ParseShort± „³ whitespace1…±No input at all“³ParseEOF±„³ annotation10…±%Line comment that's just hash-newline“³Test²…±°…±°„³ annotation11…±+Line comments: one hash-newline, one normal“³Test²…±…±normal°…±…±normal°„³ annotation12…±%Interpreter-specification annotations“³Test²#…“³ interpreter± /some/path„³value…“³ interpreter± /some/path„³value„³ annotation8a…±9Commas forbidden between @ and annotation in a collection“³ ParseError±[@,a b]„³ annotation9a…±BCommas forbidden between annotation and underlying in a collection“³ ParseError±[@a, b]„³ int2500000000“³Test²°•ł°•ł„³rfc8259-example1“³NondeterministicTest²¶·±Image·±IDsµ°t°Æ°ź°—‰„±Title±View from 15th Floor±Width° ±Height°X±Animated³false± Thumbnail·±Url±&http://www.example.com/image/481989943±Width°d±Height°}„„„·±Image·±IDsµ°t°Æ°ź°—‰„±Title±View from 15th Floor±Width° ±Height°X±Animated³false± Thumbnail·±Url±&http://www.example.com/image/481989943±Width°d±Height°}„„„„³rfc8259-example2“³NondeterministicTest²üµ·±Zip±94107±City± SAN FRANCISCO±State±CA±Address±±Country±US±Latitude‡@Bā&€IR± Longitude‡Ą^™Vlō!± precision±zip„·±Zip±94085±City± SUNNYVALE±State±CA±Address±±Country±US±Latitude‡@BƝf­“± Longitude‡Ą^ŖOŹBƱ precision±zip„„µ·±Zip±94107±City± SAN FRANCISCO±State±CA±Address±±Country±US±Latitude‡@Bā&€IR± Longitude‡Ą^™Vlō!± precision±zip„·±Zip±94085±City± SUNNYVALE±State±CA±Address±±Country±US±Latitude‡@BƝf­“± Longitude‡Ą^ŖOŹBƱ precision±zip„„„³surrogatepair0str…±Unmatched high surrogate“³ ParseError± "blah\uD834"„³surrogatepair0sym…±Unmatched high surrogate“³ ParseError± 'blah\uD834'„³surrogatepair1str…±Unmatched low surrogate“³ ParseError± "\uDD1Eblah"„³surrogatepair1sym…±Unmatched low surrogate“³ ParseError± '\uDD1Eblah'„³surrogatepair2str…±Unmatched high surrogate“³ ParseError±"blah\uD834blah"„³surrogatepair2sym…±Unmatched high surrogate“³ ParseError±'blah\uD834blah'„³surrogatepair3str…±Unmatched low surrogate“³ ParseError±"blah\uDD1Eblah"„³surrogatepair3sym…±Unmatched low surrogate“³ ParseError±'blah\uDD1Eblah'„³surrogatepair4str…±Swapped surrogates“³ ParseError±"blah\uDD1E\uD834blah"„³surrogatepair4sym…±Swapped surrogates“³ ParseError±'blah\uDD1E\uD834blah'„³surrogatepair5str…±Two high surrogates“³ ParseError±"blah\uD834\uD834blah"„³surrogatepair5sym…±Two high surrogates“³ ParseError±'blah\uD834\uD834blah'„³surrogatepair6str…±Two low surrogates“³ ParseError±"blah\uDD1E\uDD1Eblah"„³surrogatepair6sym…±Two low surrogates“³ ParseError±'blah\uDD1E\uDD1Eblah'„³"int1234567812345678123456781234567“³Test²° •+KQ‹’1‡° •+KQ‹’1‡„³#int-1234567812345678123456781234567“³Test²° šjåpŌ“ūb®tmĪy° šjåpŌ“ūb®tmĪy„³#int12345678123456781234567812345678“³Test²°›Ó —°ī.%/sµļN°›Ó —°ī.%/sµļN„³$int-12345678123456781234567812345678“³Test²°’d,öhOŃŚŠŒJ²°’d,öhOŃŚŠŒJ²„³,int87112285931760246646623899502532662132736“³Test²°°„³,int98765432109876543210987654321098765432109“³Test²°">ŚQ+Ż“ˆü–Łji1Ąõ-°">ŚQ+Ż“ˆü–Łji1Ąõ-„³-int-98765432109876543210987654321098765432109“³Test²°žŻĮ%®Ō"lwi&•–Ī? Ó°žŻĮ%®Ō"lwi&•–Ī? ӄ„„