<s> import unittest <EOL> from test import test_support <EOL> class HashEqualityTestCase ( unittest . TestCase ) : <EOL> def same_hash ( self , * objlist ) : <EOL> hashed = map ( hash , objlist ) <EOL> for h in hashed [ <NUM_LIT:1> : ] : <EOL> if h != hashed [ <NUM_LIT:0> ] : <EOL> self . fail ( "<STR_LIT>" % ( objlist , ) ) <EOL> def test_numeric_literals ( self ) : <EOL> self . same_hash ( <NUM_LIT:1> , <NUM_LIT:1> L , <NUM_LIT:1.0> , <NUM_LIT:1.0> + <NUM_LIT> ) <EOL> def test_coerced_integers ( self ) : <EOL> self . same_hash ( int ( <NUM_LIT:1> ) , long ( <NUM_LIT:1> ) , float ( <NUM_LIT:1> ) , complex ( <NUM_LIT:1> ) , <EOL> int ( '<STR_LIT:1>' ) , float ( '<STR_LIT:1.0>' ) ) <EOL> def test_coerced_floats ( self ) : <EOL> self . same_hash ( long ( <NUM_LIT> ) , float ( <NUM_LIT> ) ) <EOL> self . same_hash ( float ( <NUM_LIT:0.5> ) , complex ( <NUM_LIT:0.5> , <NUM_LIT:0.0> ) ) <EOL> def test_main ( ) : <EOL> test_support . run_unittest ( HashEqualityTestCase ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> test_main ( ) </s>
