ó |G_Tc@snddlZddlmZmZdefd„ƒYZdeefd„ƒYZdeefd„ƒYZdS( iÿÿÿÿN(tPyTesttCTesttTestScanstringcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs°|jjj}tjdkr@|j|dddtƒd;ƒn|j|dddtƒd<ƒ|j|dddtƒd=ƒ|j|d ddtƒd>ƒ|j|d ddtƒd?ƒ|j|dddtƒd@ƒ|j|dddtƒdAƒ|j|dddtƒdBƒ|j|dddtƒdCƒ|j|dddtƒdDƒ|j|dddtƒdEƒ|j|d!ddtƒdFƒ|j|d#ddtƒdGƒ|j|d%ddtƒdHƒ|j|d(ddtƒdIƒ|j|d*ddtƒdJƒ|j|d-ddtƒdKƒ|j|d0ddtƒdLƒ|j|d3ddtƒdMƒ|j|d6ddtƒdNƒ|j|d8ddtƒdOƒdS(PNiÿÿu"zð„ x"iuzð„ xiis"\u007b"u{is<"A JSON payload should be an object or array, not a string."u:A JSON payload should be an object or array, not a string.i<s["Unclosed array"iuUnclosed arrayis["extra comma",]u extra commais["double extra comma",,]udouble extra commais["Comma after the close"],uComma after the closeis["Extra close"]]u Extra closes{"Extra comma": true,}u Extra commas:{"Extra value after close": true} "misplaced quoted value"uExtra value after closeis{"Illegal expression": 1 + 2}uIllegal expressions{"Illegal invocation": alert()}uIllegal invocations+{"Numbers cannot have leading zeroes": 013}u"Numbers cannot have leading zeroesi%s{"Numbers cannot be hex": 0x14}uNumbers cannot be hexs2[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]uToo deepis{"Missing colon" null}u Missing colonis{"Double colon":: null}u Double colonis {"Comma instead of colon", null}uComma instead of colonis!["Colon instead of comma": false]uColon instead of commas["Bad value", truth]u Bad valuei (uzð„ xi(uzð„ xi(u{i(u:A JSON payload should be an object or array, not a string.i<(uUnclosed arrayi(u extra commai(udouble extra commai(uComma after the closei(u Extra closei(u Extra commai(uExtra value after closei(uIllegal expressioni(uIllegal invocationi(u"Numbers cannot have leading zeroesi%(uNumbers cannot be hexi(uToo deepi(u Missing coloni(u Double coloni(uComma instead of coloni(uColon instead of commai(u Bad valuei (tjsontdecodert scanstringtsyst maxunicodet assertEqualtNonetTrue(tselfR((s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyttest_scanstrings‚ cs¸ˆjjj‰‡‡fd†}tdƒtdƒ}|ddƒ|ddƒ|dd ƒ|d d ƒ|d d |ƒ|ddƒ|ddƒ|dd|ƒ|dd ƒdS(Ncsxˆjˆ|ddtƒ|t|ƒfƒt|tƒstt|ƒ}ˆjˆ|ddtƒ|t|ƒfƒndS(Ni(RR R tlent isinstancetunicode(tgiventexpect(RR (s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyt assertScan_s  i4Øi Ýs"z\ud834\u0079x"uzí ´yxs"z\ud834\udd20x"uzð„ xs"z\ud834\ud834\udd20x"u zí ´ð„ xs "z\ud834x"uzí ´xu"z\ud834í´ x12345"u z%sx12345s "z\udd20x"uzí´ xu"zð„ x"uzð„ xu "zí ´\udd20x"uz%sxu"zí ´x"(RRRtunichr(R Rt surrogates((RR s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyttest_surrogates]s      cCs˜|jjj}ddddddddd d d d d ddddddddddg}x7|D]/}|jtƒ||ddtƒWdQXqaWdS(Ns"\"s"\x"s"\u"s"\u0"s"\u01"s"\u012"s"\uz012"s"\u0z12"s"\u01z2"s"\u012z"s"\u0x12"s"\u0X12"s "\ud834\"s "\ud834\u"s "\ud834\ud"s "\ud834\udd"s "\ud834\udd2"s"\ud834\uzdd2"s"\ud834\udzd2"s"\ud834\uddz2"s"\ud834\udd2z"s"\ud834\u0x20"s"\ud834\u0X20"i(RRRt assertRaisest ValueErrorR R (R Rt bad_escapests((s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyttest_bad_escapesrs6  cCsB|jt|jjjdddƒ|jt|jjjdƒdS(Ntxxxisxxÿ(RRRRRtUnicodeDecodeErrortencodertencode_basestring_ascii(R ((s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyttest_issue3623‘s cCs7|jtƒ"|jjjdtjdƒWdQXdS(NRi(Rt OverflowErrorRRRRtmaxsize(R ((s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyt test_overflow—s(t__name__t __module__R RRRR"(((s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyRs  W   tTestPyScanstringcBseZRS((R#R$(((s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyR%œstTestCScanstringcBseZRS((R#R$(((s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyR&s(Rt json.testsRRtobjectRR%R&(((s6/usr/local/lib/python2.7/json/tests/test_scanstring.pyts —