<s> """<STR_LIT>""" <EOL> import unittest <EOL> from test . test_support import run_unittest , have_unicode <EOL> class UnaryOpTestCase ( unittest . TestCase ) : <EOL> def test_negative ( self ) : <EOL> self . assertTrue ( - <NUM_LIT:2> == <NUM_LIT:0> - <NUM_LIT:2> ) <EOL> self . assertTrue ( - <NUM_LIT:0> == <NUM_LIT:0> ) <EOL> self . assertTrue ( - - <NUM_LIT:2> == <NUM_LIT:2> ) <EOL> self . assertTrue ( - <NUM_LIT:2> L == <NUM_LIT:0> - <NUM_LIT:2> L ) <EOL> self . assertTrue ( - <NUM_LIT> == <NUM_LIT:0> - <NUM_LIT> ) <EOL> self . assertTrue ( - <NUM_LIT> == <NUM_LIT:0> - <NUM_LIT> ) <EOL> def test_positive ( self ) : <EOL> self . assertTrue ( + <NUM_LIT:2> == <NUM_LIT:2> ) <EOL> self . assertTrue ( + <NUM_LIT:0> == <NUM_LIT:0> ) <EOL> self . assertTrue ( + + <NUM_LIT:2> == <NUM_LIT:2> ) <EOL> self . assertTrue ( + <NUM_LIT:2> L == <NUM_LIT:2> L ) <EOL> self . assertTrue ( + <NUM_LIT> == <NUM_LIT> ) <EOL> self . assertTrue ( + <NUM_LIT> == <NUM_LIT> ) <EOL> def test_invert ( self ) : <EOL> self . assertTrue ( - <NUM_LIT:2> == <NUM_LIT:0> - <NUM_LIT:2> ) <EOL> self . assertTrue ( - <NUM_LIT:0> == <NUM_LIT:0> ) <EOL> self . assertTrue ( - - <NUM_LIT:2> == <NUM_LIT:2> ) <EOL> self . assertTrue ( - <NUM_LIT:2> L == <NUM_LIT:0> - <NUM_LIT:2> L ) <EOL> def test_no_overflow ( self ) : <EOL> nines = "<STR_LIT>" * <NUM_LIT:32> <EOL> self . assertTrue ( eval ( "<STR_LIT:+>" + nines ) == eval ( "<STR_LIT:+>" + nines + "<STR_LIT:L>" ) ) <EOL> self . assertTrue ( eval ( "<STR_LIT:->" + nines ) == eval ( "<STR_LIT:->" + nines + "<STR_LIT:L>" ) ) <EOL> self . assertTrue ( eval ( "<STR_LIT>" + nines ) == eval ( "<STR_LIT>" + nines + "<STR_LIT:L>" ) ) <EOL> def test_negation_of_exponentiation ( self ) : <EOL> self . assertEqual ( - <NUM_LIT:2> ** <NUM_LIT:3> , - <NUM_LIT:8> ) <EOL> self . assertEqual ( ( - <NUM_LIT:2> ) ** <NUM_LIT:3> , - <NUM_LIT:8> ) <EOL> self . assertEqual ( - <NUM_LIT:2> ** <NUM_LIT:4> , - <NUM_LIT:16> ) <EOL> self . assertEqual ( ( - <NUM_LIT:2> ) ** <NUM_LIT:4> , <NUM_LIT:16> ) <EOL> def test_bad_types ( self ) : <EOL> for op in '<STR_LIT:+>' , '<STR_LIT:->' , '<STR_LIT>' : <EOL> self . assertRaises ( TypeError , eval , op + "<STR_LIT>" ) <EOL> if have_unicode : <EOL> self . assertRaises ( TypeError , eval , op + "<STR_LIT>" ) <EOL> self . assertRaises ( TypeError , eval , "<STR_LIT>" ) <EOL> self . assertRaises ( TypeError , eval , "<STR_LIT>" ) <EOL> def test_main ( ) : <EOL> run_unittest ( UnaryOpTestCase ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> test_main ( ) </s>
