<s> from test . test_support import * <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> if None : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:0> : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:0> L : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:0.0> : raise TestFailed , '<STR_LIT>' <EOL> if '<STR_LIT>' : raise TestFailed , '<STR_LIT>' <EOL> if not <NUM_LIT:1> : raise TestFailed , '<STR_LIT>' <EOL> if not <NUM_LIT:1> L : raise TestFailed , '<STR_LIT>' <EOL> if not <NUM_LIT:1.0> : raise TestFailed , '<STR_LIT>' <EOL> if not '<STR_LIT:x>' : raise TestFailed , '<STR_LIT>' <EOL> if not { '<STR_LIT:x>' : <NUM_LIT:1> } : raise TestFailed , '<STR_LIT>' <EOL> def f ( ) : pass <EOL> class C : pass <EOL> import sys <EOL> x = C ( ) <EOL> if not f : raise TestFailed , '<STR_LIT>' <EOL> if not C : raise TestFailed , '<STR_LIT>' <EOL> if not sys : raise TestFailed , '<STR_LIT>' <EOL> if not x : raise TestFailed , '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> if <NUM_LIT:0> or <NUM_LIT:0> : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:1> and <NUM_LIT:1> : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> if not <NUM_LIT:1> : raise TestFailed , '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> if <NUM_LIT:0> < <NUM_LIT:1> <= <NUM_LIT:1> == <NUM_LIT:1> >= <NUM_LIT:1> > <NUM_LIT:0> != <NUM_LIT:1> : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:0> L < <NUM_LIT:1> L <= <NUM_LIT:1> L == <NUM_LIT:1> L >= <NUM_LIT:1> L > <NUM_LIT:0> L != <NUM_LIT:1> L : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:0.0> < <NUM_LIT:1.0> <= <NUM_LIT:1.0> == <NUM_LIT:1.0> >= <NUM_LIT:1.0> > <NUM_LIT:0.0> != <NUM_LIT:1.0> : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> if '<STR_LIT>' < '<STR_LIT:a>' <= '<STR_LIT:a>' == '<STR_LIT:a>' < '<STR_LIT:abc>' < '<STR_LIT>' < '<STR_LIT:b>' : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> if None is None : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> try : float ( '<STR_LIT>' ) <EOL> except ValueError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> try : float ( '<STR_LIT>' ) <EOL> except ValueError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> try : <NUM_LIT> / <NUM_LIT:0.0> <EOL> except ZeroDivisionError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> try : <NUM_LIT> // <NUM_LIT:0.0> <EOL> except ZeroDivisionError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> try : <NUM_LIT> % <NUM_LIT:0.0> <EOL> except ZeroDivisionError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> try : <NUM_LIT:5> / <NUM_LIT:0> L <EOL> except ZeroDivisionError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> try : <NUM_LIT:5> // <NUM_LIT:0> L <EOL> except ZeroDivisionError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> try : <NUM_LIT:5> % <NUM_LIT:0> L <EOL> except ZeroDivisionError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> print '<STR_LIT>' <EOL> if <NUM_LIT:0> != <NUM_LIT:0> L or <NUM_LIT:0> != <NUM_LIT:0.0> or <NUM_LIT:0> L != <NUM_LIT:0.0> : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:1> != <NUM_LIT:1> L or <NUM_LIT:1> != <NUM_LIT:1.0> or <NUM_LIT:1> L != <NUM_LIT:1.0> : raise TestFailed , '<STR_LIT>' <EOL> if - <NUM_LIT:1> != - <NUM_LIT:1> L or - <NUM_LIT:1> != - <NUM_LIT:1.0> or - <NUM_LIT:1> L != - <NUM_LIT:1.0> : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if int ( ) != <NUM_LIT:0> : raise TestFailed , '<STR_LIT>' <EOL> if long ( ) != <NUM_LIT:0> L : raise TestFailed , '<STR_LIT>' <EOL> if float ( ) != <NUM_LIT:0.0> : raise TestFailed , '<STR_LIT>' <EOL> if int ( <NUM_LIT> ) == <NUM_LIT:1> == int ( <NUM_LIT> ) and int ( - <NUM_LIT> ) == - <NUM_LIT:1> == int ( - <NUM_LIT> ) : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> if long ( <NUM_LIT> ) == <NUM_LIT:1> L == long ( <NUM_LIT> ) and long ( - <NUM_LIT> ) == - <NUM_LIT:1> L == long ( - <NUM_LIT> ) : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> if float ( <NUM_LIT:1> ) == <NUM_LIT:1.0> and float ( - <NUM_LIT:1> ) == - <NUM_LIT:1.0> and float ( <NUM_LIT:0> ) == <NUM_LIT:0.0> : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> a = <NUM_LIT> <EOL> b = <NUM_LIT> * <NUM_LIT:2> <EOL> if a is not b : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:12> + <NUM_LIT> != <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:12> + ( - <NUM_LIT> ) != - <NUM_LIT:12> : raise TestFailed , '<STR_LIT>' <EOL> if ( - <NUM_LIT:12> ) + <NUM_LIT> != <NUM_LIT:12> : raise TestFailed , '<STR_LIT>' <EOL> if ( - <NUM_LIT:12> ) + ( - <NUM_LIT> ) != - <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> if not <NUM_LIT:12> < <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> if not - <NUM_LIT> < - <NUM_LIT:12> : raise TestFailed , '<STR_LIT>' <EOL> xsize , ysize , zsize = <NUM_LIT> , <NUM_LIT> , <NUM_LIT:4> <EOL> if not ( xsize * ysize * zsize == zsize * xsize * ysize == <NUM_LIT> ) : <EOL> raise TestFailed , '<STR_LIT>' <EOL> m = - sys . maxint - <NUM_LIT:1> <EOL> for divisor in <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:8> , <NUM_LIT:16> , <NUM_LIT:32> : <EOL> j = m // divisor <EOL> prod = divisor * j <EOL> if prod != m : <EOL> raise TestFailed , "<STR_LIT>" % ( divisor , j , prod , m ) <EOL> if type ( prod ) is not int : <EOL> raise TestFailed , ( "<STR_LIT>" % <EOL> type ( prod ) ) <EOL> for divisor in <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:8> , <NUM_LIT:16> , <NUM_LIT:32> : <EOL> j = m // divisor - <NUM_LIT:1> <EOL> prod = divisor * j <EOL> if type ( prod ) is not long : <EOL> raise TestFailed , ( "<STR_LIT>" % <EOL> ( prod , type ( prod ) ) ) <EOL> m = sys . maxint <EOL> for divisor in <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:8> , <NUM_LIT:16> , <NUM_LIT:32> : <EOL> j = m // divisor + <NUM_LIT:1> <EOL> prod = divisor * j <EOL> if type ( prod ) is not long : <EOL> raise TestFailed , ( "<STR_LIT>" % <EOL> ( prod , type ( prod ) ) ) <EOL> print '<STR_LIT>' <EOL> if <NUM_LIT:12> L + <NUM_LIT> L != <NUM_LIT> L : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:12> L + ( - <NUM_LIT> L ) != - <NUM_LIT:12> L : raise TestFailed , '<STR_LIT>' <EOL> if ( - <NUM_LIT:12> L ) + <NUM_LIT> L != <NUM_LIT:12> L : raise TestFailed , '<STR_LIT>' <EOL> if ( - <NUM_LIT:12> L ) + ( - <NUM_LIT> L ) != - <NUM_LIT> L : raise TestFailed , '<STR_LIT>' <EOL> if not <NUM_LIT:12> L < <NUM_LIT> L : raise TestFailed , '<STR_LIT>' <EOL> if not - <NUM_LIT> L < - <NUM_LIT:12> L : raise TestFailed , '<STR_LIT>' <EOL> x = sys . maxint <EOL> if int ( long ( x ) ) != x : raise TestFailed , '<STR_LIT>' <EOL> try : y = int ( long ( x ) + <NUM_LIT:1> L ) <EOL> except OverflowError : raise TestFailed , '<STR_LIT>' <EOL> if not isinstance ( y , long ) : raise TestFailed , '<STR_LIT>' <EOL> x = - x <EOL> if int ( long ( x ) ) != x : raise TestFailed , '<STR_LIT>' <EOL> x = x - <NUM_LIT:1> <EOL> if int ( long ( x ) ) != x : raise TestFailed , '<STR_LIT>' <EOL> try : y = int ( long ( x ) - <NUM_LIT:1> L ) <EOL> except OverflowError : raise TestFailed , '<STR_LIT>' <EOL> if not isinstance ( y , long ) : raise TestFailed , '<STR_LIT>' <EOL> try : <NUM_LIT:5> << - <NUM_LIT:5> <EOL> except ValueError : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> try : <NUM_LIT:5> L << - <NUM_LIT:5> L <EOL> except ValueError : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> try : <NUM_LIT:5> >> - <NUM_LIT:5> <EOL> except ValueError : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> try : <NUM_LIT:5> L >> - <NUM_LIT:5> L <EOL> except ValueError : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> if <NUM_LIT> + <NUM_LIT> != <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT> + ( - <NUM_LIT> ) != - <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> if ( - <NUM_LIT> ) + <NUM_LIT> != <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> if ( - <NUM_LIT> ) + ( - <NUM_LIT> ) != - <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> if not <NUM_LIT> < <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> if not - <NUM_LIT> < - <NUM_LIT> : raise TestFailed , '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> if len ( '<STR_LIT>' ) != <NUM_LIT:0> : raise TestFailed , '<STR_LIT>' <EOL> if len ( '<STR_LIT:a>' ) != <NUM_LIT:1> : raise TestFailed , '<STR_LIT>' <EOL> if len ( '<STR_LIT>' ) != <NUM_LIT:6> : raise TestFailed , '<STR_LIT>' <EOL> if '<STR_LIT>' + '<STR_LIT>' != '<STR_LIT>' : raise TestFailed , '<STR_LIT>' <EOL> if '<STR_LIT>' * <NUM_LIT:3> != '<STR_LIT>' : raise TestFailed , '<STR_LIT>' <EOL> if <NUM_LIT:0> * '<STR_LIT>' != '<STR_LIT>' : raise TestFailed , '<STR_LIT>' <EOL> if min ( '<STR_LIT:abc>' ) != '<STR_LIT:a>' or max ( '<STR_LIT:abc>' ) != '<STR_LIT:c>' : raise TestFailed , '<STR_LIT>' <EOL> if '<STR_LIT:a>' in '<STR_LIT:abc>' and '<STR_LIT:b>' in '<STR_LIT:abc>' and '<STR_LIT:c>' in '<STR_LIT:abc>' and '<STR_LIT:d>' not in '<STR_LIT:abc>' : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> x = '<STR_LIT:x>' * <NUM_LIT> <EOL> if '<STR_LIT>' % x != x + '<STR_LIT:!>' : raise TestFailed , '<STR_LIT>' <EOL> a = '<STR_LIT>' <EOL> vereq ( a [ : : ] , a ) <EOL> vereq ( a [ : : <NUM_LIT:2> ] , '<STR_LIT>' ) <EOL> vereq ( a [ <NUM_LIT:1> : : <NUM_LIT:2> ] , '<STR_LIT>' ) <EOL> vereq ( a [ : : - <NUM_LIT:1> ] , '<STR_LIT>' ) <EOL> vereq ( a [ : : - <NUM_LIT:2> ] , '<STR_LIT>' ) <EOL> vereq ( a [ <NUM_LIT:3> : : - <NUM_LIT:2> ] , '<STR_LIT>' ) <EOL> vereq ( a [ - <NUM_LIT:100> : <NUM_LIT:100> : ] , a ) <EOL> vereq ( a [ <NUM_LIT:100> : - <NUM_LIT:100> : - <NUM_LIT:1> ] , a [ : : - <NUM_LIT:1> ] ) <EOL> vereq ( a [ - <NUM_LIT:100> L : <NUM_LIT:100> L : <NUM_LIT:2> L ] , '<STR_LIT>' ) <EOL> if have_unicode : <EOL> a = unicode ( '<STR_LIT>' , '<STR_LIT:ascii>' ) <EOL> vereq ( a [ : : ] , a ) <EOL> vereq ( a [ : : <NUM_LIT:2> ] , unicode ( '<STR_LIT>' , '<STR_LIT:ascii>' ) ) <EOL> vereq ( a [ <NUM_LIT:1> : : <NUM_LIT:2> ] , unicode ( '<STR_LIT>' , '<STR_LIT:ascii>' ) ) <EOL> vereq ( a [ : : - <NUM_LIT:1> ] , unicode ( '<STR_LIT>' , '<STR_LIT:ascii>' ) ) <EOL> vereq ( a [ : : - <NUM_LIT:2> ] , unicode ( '<STR_LIT>' , '<STR_LIT:ascii>' ) ) <EOL> vereq ( a [ <NUM_LIT:3> : : - <NUM_LIT:2> ] , unicode ( '<STR_LIT>' , '<STR_LIT:ascii>' ) ) <EOL> vereq ( a [ - <NUM_LIT:100> : <NUM_LIT:100> : ] , a ) <EOL> vereq ( a [ <NUM_LIT:100> : - <NUM_LIT:100> : - <NUM_LIT:1> ] , a [ : : - <NUM_LIT:1> ] ) <EOL> vereq ( a [ - <NUM_LIT:100> L : <NUM_LIT:100> L : <NUM_LIT:2> L ] , unicode ( '<STR_LIT>' , '<STR_LIT:ascii>' ) ) <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> try : type ( <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> except TypeError : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> try : type ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ) <EOL> except TypeError : pass <EOL> else : raise TestFailed , '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> if not is_jython : <EOL> try : buffer ( '<STR_LIT>' , - <NUM_LIT:1> ) <EOL> except ValueError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> cmp ( buffer ( "<STR_LIT:abc>" ) , buffer ( "<STR_LIT>" ) ) <EOL> try : buffer ( None ) <EOL> except TypeError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> a = buffer ( '<STR_LIT>' ) <EOL> hash ( a ) <EOL> b = a * <NUM_LIT:5> <EOL> if a == b : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( b ) != ( '<STR_LIT>' * <NUM_LIT:5> ) : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( a * <NUM_LIT:0> ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( a + buffer ( '<STR_LIT>' ) ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( buffer ( a ) ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( buffer ( a , <NUM_LIT:2> ) ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( buffer ( a , <NUM_LIT:0> , <NUM_LIT:2> ) ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( buffer ( a , <NUM_LIT:1> , <NUM_LIT:2> ) ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> try : buffer ( buffer ( '<STR_LIT>' , <NUM_LIT:1> ) , - <NUM_LIT:1> ) <EOL> except ValueError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> if str ( buffer ( buffer ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:2> ) , <NUM_LIT:0> ) ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( buffer ( buffer ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:2> ) , <NUM_LIT:0> , <NUM_LIT> ) ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( buffer ( buffer ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:2> ) , <NUM_LIT:0> , - <NUM_LIT:1> ) ) != '<STR_LIT>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> if str ( buffer ( buffer ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:2> ) , <NUM_LIT:1> , <NUM_LIT:2> ) ) != '<STR_LIT:s>' : <EOL> raise TestFailed , '<STR_LIT>' <EOL> try : a [ <NUM_LIT:1> ] = '<STR_LIT:g>' <EOL> except TypeError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> try : a [ <NUM_LIT:0> : <NUM_LIT:1> ] = '<STR_LIT:g>' <EOL> except TypeError : pass <EOL> else : raise TestFailed , "<STR_LIT>" <EOL> import array <EOL> try : int ( buffer ( array . array ( '<STR_LIT:c>' ) ) ) <EOL> except TypeError : pass <EOL> else : raise TestFailed , "<STR_LIT>" </s>
