ó ÖÉÎSc@sdddlZddlmZddlZddlZddlmZmZdefd„ƒYZ dS(iÿÿÿÿN(tTestCase(tbtPY3tTestScanStringcBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs|jtjjƒdS(N(t_test_scanstringt simplejsontdecodert py_scanstring(tself((sF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyttest_py_scanstringscCs'tjjsdS|jtjjƒdS(N(RRt c_scanstringR(R((sF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyttest_c_scanstrings cCs7tjdkr1|j|dddtƒdHƒn|j|dddtƒdIƒ|j|dddtƒdJƒ|j|d ddtƒdKƒ|j|d ddtƒdLƒ|j|dddtƒdMƒ|j|dddtƒdNƒ|j|dddtƒdOƒ|j|dddtƒdPƒ|j|dddtƒdQƒ|j|dddtƒdRƒ|j|d!ddtƒdSƒ|j|d#ddtƒdTƒ|j|d%ddtƒdUƒ|j|d(ddtƒdVƒ|j|d*ddtƒdWƒ|j|d-ddtƒdXƒ|j|d0ddtƒdYƒ|j|d3ddtƒdZƒ|j|d6ddtƒd[ƒ|j|d8ddtƒd\ƒxitttd;d<ƒƒD]O}|j||d=d;dtƒ|dfƒ|j t ||d=d;dtƒq¶W|j t |d>d;dtƒ|j t |d?d;dtƒ|j t |d@d;dtƒ|j t |dAd;dtƒ|j t |dBd;dtƒ|j t |dCd;dtƒ|j t |dDd;dtƒ|j t |dEd;dtƒtjdkr3|j t |dFd;dtƒ|j t |dGd;dtƒndS(]Niÿÿ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 iit"ttas\s\us\u0s\u01s\u012s\u0123s \ud834\u"s \ud834\x0123"(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 ( tsyst maxunicodet assertEqualtNonetTruetmaptchrtrangetFalset assertRaisest ValueError(Rt scanstringtc((sF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyRs¨    cCsB|jttjjdddƒ|jttjjtdƒƒdS(Ntxxxisxxÿ( RRtjsonRRtUnicodeDecodeErrortencodertencode_basestring_asciiR(R((sF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyttest_issue3623…s cCsTttdttddƒƒ}|dk s0t‚|jttjjd|dƒdS(NtmaxsizetmaxintRi( tgetattrRRtAssertionErrorRt OverflowErrorRRR(RR"((sF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyt test_overflow‹scstjj‰t‡‡fd†}|ddƒ|ddƒ|ddƒ|dd ƒ|d d ƒ|d d ƒ|d djddgƒƒ|ddjddgƒƒ|djddgƒdjddgƒdtƒˆjtˆdddtƒˆjtˆdddtƒdS(Ncs…|g}t r/|r/|j|jdƒƒnxO|D]G}ˆ|ddtƒ\}}ˆjt|ƒ|ƒˆj||ƒq6WdS(Ntutf8i(RtappendtencodeRRRtlen(tgiventexpectt test_utf8tgivenstrestcount(RR(sF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyt assertScan•s   u"z\ud834\u0079x"uzí ´yxu"z\ud834\udd20x"uzð„ xu"z\ud834\ud834\udd20x"u zí ´ð„ xu "z\ud834x"uzí ´xu "z\udd20x"uzí´ xu"zí ´x"u"z\ud834í´ x12345"uuzí ´u í´ x12345u "zí ´\udd20x"uí´ xu"zí ´uí´ x"R.u "z\ud83x"iu"z\ud834\udd2x"( RRRRtjoinRRRR(RR2((RRsF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyttest_surrogates’sD    (t__name__t __module__R R RR!R'R4(((sF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyRs    l  ( RtunittestRRRtsimplejson.decodertsimplejson.compatRRR(((sF/usr/lib64/python2.7/site-packages/simplejson/tests/test_scanstring.pyts