%PDF- %PDF-
Direktori : /usr/local/lib/python2.7/test/ |
Current File : //usr/local/lib/python2.7/test/test_sort.pyc |
ó Nêáac @ sÆ d d l m Z d d l Z d d l Z d d l Z e j Z d a d d „ Z d e j f d „ ƒ YZ d e j f d „ ƒ YZ d e j f d „ ƒ YZ d d „ Z e d k r e d e ƒ n d S( iÿÿÿÿ( t test_supportNi c C sþ t r d G| GHn | } | r/ | j | ƒ n | j ƒ t | ƒ t | ƒ k r d G| GHd Gt | ƒ Gt | ƒ GH| GH| GH| GHt d 7a d Sxg t | ƒ D]Y \ } } | | } | | k r d G| GHd G| G| G| GH| GH| GH| GHt d 7a d Sq Wd S( Ns checkings error ins length mismatch;i s out of order at index( t verboset sortt lent nerrorst enumerate( t tagt expectedt rawt comparet origt it goodt maybe( ( s* /usr/local/lib/python2.7/test/test_sort.pyt check s0 t TestBasec B s e Z d „ Z RS( c s¢ d g } x? t d d ƒ D]. } d | } | j t | d | d ƒ ƒ q W| j d d d g ƒ d t f ‡ f d † ƒ Y‰ d t f d „ ƒ Y} x| D] } t | ƒ } t r¾ d G| GHn | } t d | | ƒ | } | j ƒ t d | | ƒ | } t j | ƒ t d | | ƒ | } | j ƒ | } t d | | d „ ƒ t r[d GHd GHn | } | j d „ ƒ t d | | ƒ g | D] } ˆ | ƒ ^ q‰} | } t j | ƒ t ˆ _ t } y | j ƒ Wn t k rët } n X| rt ˆ _ t d | | ƒ n g t | ƒ D] } | t j d ƒ | ƒ ^ q} g | D] } | | j f ^ qF} | j ƒ g | D] \ } } | ^ qr} t d | | ƒ qš Wd S( Ni i i i id iè t Complainsc s/ e Z e Z d „ Z ‡ f d † Z d „ Z RS( c S s | | _ d S( N( R ( t selfR ( ( s* /usr/local/lib/python2.7/test/test_sort.pyt __init__5 s c sJ ˆ j r: t j ƒ d k r: t r1 d G| G| GHn t ‚ n | j | j k S( Ngü©ñÒMbP?s complaining at( t maybe_complaint randomR t RuntimeErrorR ( R t other( R ( s* /usr/local/lib/python2.7/test/test_sort.pyt __lt__8 s c S s d | j S( Ns Complains(%d)( R ( R ( ( s* /usr/local/lib/python2.7/test/test_sort.pyt __repr__? s ( t __name__t __module__t TrueR R R R ( ( R ( s* /usr/local/lib/python2.7/test/test_sort.pyR 2 s t Stablec B s) e Z d „ Z d „ Z d Z d „ Z RS( c S s | | _ | | _ d S( N( t keyt index( R R R ( ( s* /usr/local/lib/python2.7/test/test_sort.pyR C s c S s t | j | j ƒ S( N( t cmpR ( R R ( ( s* /usr/local/lib/python2.7/test/test_sort.pyt __cmp__G s c S s d | j | j f S( Ns Stable(%d, %d)( R R ( R ( ( s* /usr/local/lib/python2.7/test/test_sort.pyR K s N( R R R R t Nonet __hash__R ( ( ( s* /usr/local/lib/python2.7/test/test_sort.pyR B s s Testing sizet identityt reverseds random permutations reversed via functionc S s t | | ƒ S( N( R ( t at b( ( s* /usr/local/lib/python2.7/test/test_sort.pyt <lambda>a t s3 Checking against an insane comparison function.s? If the implementation isn't careful, this may segfault.c S s t t j ƒ d ƒ d S( Ni i ( t intR ( R% R&