ó
ìUzMc           @   s›   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 g Z i d d 6d d 6Z d  e f d! „  ƒ  YZ d S("   iÿÿÿÿ(   t   TestCaseNs<   "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    ["Illegal backslash escape: \'"]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']u$   ["AZ control characters in string"]s   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 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>   /usr/lib/python2.7/dist-packages/simplejson/tests/test_fail.pyt   test_failuresA   s    
c         C   s´   x­ d d g D]Ÿ } y t  j | ƒ Wnx t  j k
 ru } |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ q t k
 rž } |  j d | | f ƒ q X|  j d ƒ q Wd  S(   Nu   [,]s   [,]i   s!   Unexpected exception raised %r %ss    Unexpected success parsing '[,]'(	   R   R   R   t   assertEqualst   post   linenot   colnot	   ExceptionR   (   R	   R   t   e(    (    s>   /usr/lib/python2.7/dist-packages/simplejson/tests/test_fail.pyt   test_array_decoder_issue46O   s    (   t   __name__t
   __module__R   R   (    (    (    s>   /usr/lib/python2.7/dist-packages/simplejson/tests/test_fail.pyR   @   s   	(   t   unittestR    t
   simplejsonR   R   R   R   (    (    (    s>   /usr/lib/python2.7/dist-packages/simplejson/tests/test_fail.pyt   <module>   s<   	
