
    <i6                     H    S SK r S SKJr  S SKr/ SQrSSS.r " S S\5      rg)	    N)TestCase):z<"A JSON payload should be an object or array, not a string."z["Unclosed array"z%{unquoted_key: "keys must be quoted"}z["extra comma",]z["double extra comma",,]z[   , "<-- missing value"]z["Comma after the close"],z["Extra close"]]z{"Extra comma": true,}z:{"Extra value after close": true} "misplaced quoted value"z{"Illegal expression": 1 + 2}z{"Illegal invocation": alert()}z+{"Numbers cannot have leading zeroes": 013}z{"Numbers cannot be hex": 0x14}z"["Illegal backslash escape: \x15"]z[\naked]z"["Illegal backslash escape: \017"]z2[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]z{"Missing colon" null}z{"Double colon":: null}z {"Comma instead of colon", null}z!["Colon instead of comma": false]z["Bad value", truth]z['single quote']z["	tab	character	in	string	"]z&["tab\   character\   in\  string\  "]z["line
break"]z["line\
break"]z[0e]z[0e+]z[0e+-1]z({"Comma instead if closing brace": true,z["mismatch"}z$["AZ control characters in string"]{z{]z{"foo": "bar"]z{"foo": "bar"nulnulx-z-xz-ez-e0z	-Infinitez-InfInfinitInfiniteNaMNuNfalsyfaltrugtru1e1exz1e-z1e-xzwhy not have a string payload?z,spec doesn't specify any nesting limitations)      c                   &    \ rS rSrS rS rS rSrg)TestFaill   c                    [        [        5       HX  u  pUS-   nU[        ;   a  [        R                  " U5        M,   [        R                  " U5        U R                  SX4-  5        MZ     g ! [        R                   a     Mt  f = f)Nr   z$Expected failure for fail%d.json: %r)	enumerateJSONDOCSSKIPSjsonloadsfailJSONDecodeError)selfidxdocs      T/home/james-whalen/.local/lib/python3.13/site-packages/simplejson/tests/test_fail.pytest_failuresTestFail.test_failuresm   sr    !(+HC'Ce|

3O

3 		@C:MN , '' s   A--BBc                    S H+  n [         R                  " U5        U R                  S5        M-     g ! [         R                   ap    [        R
                  " 5       S   nU R                  UR                  S5        U R                  UR                  S5        U R                  UR                  S5         M  [         a5    [        R
                  " 5       S   nU R                  SU< SU< 35         M  f = f)N)[,]r&   z Unexpected success parsing '[,]'r      Unexpected exception raised  )r   r   r   r   sysexc_infoassertEqualposlinenocolno	Exception)r   r!   es      r"   test_array_decoder_issue46#TestFail.test_array_decoder_issue46z   s    "C>

3 		<= # '' -LLN1%  *  1-  !, HLLN1%		AFGHs   3B C46:C43C4c                 B   / SQnU H3  u  p#n [         R                  " U5        U R                  SU< S35        M5     g ! [         R                   a    [        R
                  " 5       S   nU R                  UR                  S [        U5       UUR                  < SU< SU< 35        U R                  UR                  USUR                  < SU< SU< 35         M  [         a6    [        R
                  " 5       S   nU R                  S	U< S
U< 35         GM  f = f)N)) Expecting valuer   )[zExpecting value or ']'r   )z[42Expecting ',' delimiter   )z[42,r6      )z["Unterminated string starting atr   )z["spamr;   r   )z["spam"r8      )z["spam",r6      )r   z8Expecting property name enclosed in double quotes or '}'r   )z{"r;   r   )z{"spamr;   r   )z{"spam"zExpecting ':' delimiterr<   )z{"spam":r6   r=   )z
{"spam":42r8   
   )z{"spam":42,z1Expecting property name enclosed in double quotes   )"r;   r   )z"spamr;   r   )z[,r6   r   )z--r6   r   )z"dzInvalid control character %rr   zUnexpected success parsing ''r   z doesn't start with z for zpos z != r(   r)   )r   r   r   r   r*   r+   r,   msglenr-   r0   )r   
test_casesdatarB   r    r1   s         r"   test_truncated_inputTestFail.test_truncated_input   s    

. )NDsG

4  		tEF! ) '' @LLN1%  EE)3s8$9:TJL   EE3-.UUC>@  HLLN1%		AFGGHs   ?BD:DD N)__name__
__module____qualname____firstlineno__r#   r2   rF   __static_attributes__rH       r"   r   r   l   s    O> (GrN   r   )r*   unittestr   
simplejsonr   r   r   r   rH   rN   r"   <module>rQ      s6    
  ^B (6	
FGx FGrN   