ó
P'—^c        :   @   s
  d  d l  Z  d  d l m Z d  d l Z d d d d d d d	 d
 d d d d d d d d d d d d d d d d d d d d d d  d! d" d# d$ d% d& d' d( d) d* d+ d, d- d. d/ d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d: d; d< g: Z i d= d> 6d? d@ 6Z dA e f dB „  ƒ  YZ d S(C   iÿÿÿÿN(   t   TestCases<   "A JSON payload should be an object or array, not a string."s   ["Unclosed array"s%   {unquoted_key: "keys must be quoted"}s   ["extra comma",]s   ["double extra comma",,]s   [   , "<-- missing value"]s   ["Comma after the close"],s   ["Extra close"]]s   {"Extra comma": true,}s:   {"Extra value after close": true} "misplaced quoted value"s   {"Illegal expression": 1 + 2}s   {"Illegal invocation": alert()}s+   {"Numbers cannot have leading zeroes": 013}s   {"Numbers cannot be hex": 0x14}s"   ["Illegal backslash escape: \x15"]s   [\naked]s"   ["Illegal backslash escape: \017"]s2   [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]s   {"Missing colon" null}s   {"Double colon":: null}s    {"Comma instead of colon", null}s!   ["Colon instead of comma": false]s   ["Bad value", truth]s   ['single quote']s   ["	tab	character	in	string	"]s&   ["tab\   character\   in\  string\  "]s   ["line
break"]s   ["line\
break"]s   [0e]s   [0e+]s   [0e+-1]s(   {"Comma instead if closing brace": true,s   ["mismatch"}u$   ["AZ control characters in string"]t   {s   {]s   {"foo": "bar"]s   {"foo": "bar"t   nult   nulxt   -s   -xs   -es   -e0s	   -Infinites   -Inft   Infinitt   Infinitet   NaMt   NuNt   falsyt   falt   trugt   trut   1et   1exs   1e-s   1e-xs   why not have a string payload?i   s,   spec doesn't specify any nesting limitationsi   t   TestFailc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s‰   x‚ t  t ƒ D]t \ } } | d } | t k rB t j | ƒ q n  y t j | ƒ Wn t j k
 ri q X|  j d | | f ƒ q Wd  S(   Ni   s$   Expected failure for fail%d.json: %r(   t	   enumeratet   JSONDOCSt   SKIPSt   jsont   loadst   JSONDecodeErrort   fail(   t   selft   idxt   doc(    (    s<   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_fail.pyt   test_failuresm   s    
c         C   sÐ   xÉ d d g D]» } y t  j | ƒ Wn” t  j k
 rƒ t j ƒ  d } |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ q t	 k
 rº t j ƒ  d } |  j
 d | | f ƒ q X|  j
 d ƒ q Wd  S(   Nu   [,]s   [,]i   i   s!   Unexpected exception raised %r %ss    Unexpected success parsing '[,]'(   R   R   R   t   syst   exc_infot   assertEqualt   post   linenot   colnot	   ExceptionR   (   R   R   t   e(    (    s<   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_fail.pyt   test_array_decoder_issue46z   s    c         C   s3  d% d& d' d( d) d* d+ d, d- d. d/ d0 d1 d2 d3 d4 d5 d6 g } xð | D]è \ } } } y t  j | ƒ Wn± t  j k
 rß t j ƒ  d } |  j | j t | ƒ  | d! | j | | f ƒ |  j | j | d" | j | | f ƒ qC t	 k
 rt j ƒ  d } |  j
 d# | | f ƒ qC X|  j
 d$ | f ƒ qC Wd  S(7   Nt    s   Expecting valuei    t   [s   Expecting value or ']'i   s   [42s   Expecting ',' delimiteri   s   [42,i   s   ["s   Unterminated string starting ats   ["spams   ["spam"i   s   ["spam",i   R   s1   Expecting property name enclosed in double quotess   {"s   {"spams   {"spam"s   Expecting ':' delimiters   {"spam":s
   {"spam":42i
   s   {"spam":42,i   t   "s   "spams   [,s   %r doesn't start with %r for %rs   pos %r != %r for %rs!   Unexpected exception raised %r %ss   Unexpected success parsing '%r'(   R$   s   Expecting valuei    (   R%   s   Expecting value or ']'i   (   s   [42s   Expecting ',' delimiteri   (   s   [42,s   Expecting valuei   (   s   ["s   Unterminated string starting ati   (   s   ["spams   Unterminated string starting ati   (   s   ["spam"s   Expecting ',' delimiteri   (   s   ["spam",s   Expecting valuei   (   R   s1   Expecting property name enclosed in double quotesi   (   s   {"s   Unterminated string starting ati   (   s   {"spams   Unterminated string starting ati   (   s   {"spam"s   Expecting ':' delimiteri   (   s   {"spam":s   Expecting valuei   (   s
   {"spam":42s   Expecting ',' delimiteri
   (   s   {"spam":42,s1   Expecting property name enclosed in double quotesi   (   R&   s   Unterminated string starting ati    (   s   "spams   Unterminated string starting ati    (   s   [,s   Expecting valuei   (   R   R   R   R   R   R   t   msgt   lenR   R!   R   (   R   t
   test_casest   dataR'   R   R"   (    (    s<   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_fail.pyt   test_truncated_inputŠ   sF     		(   t   __name__t
   __module__R   R#   R+   (    (    (    s<   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_fail.pyR   l   s   		(   R   t   unittestR    t
   simplejsonR   R   R   R   (    (    (    s<   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_fail.pyt   <module>   s€   	
