#NEWLINE# def test_compare( self ) : #NEWLINE# #INDENT# t = table ( 't' , column ( 'x' ) , column ( 'y' ) ) #NEWLINE# x_a = t . c . x . _annotate ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# assert t . c . x . compare ( x_a ) #NEWLINE# assert x_a . compare ( t . c . x ) #NEWLINE# assert ( not x_a . compare ( t . c . y ) ) #NEWLINE# assert ( not t . c . y . compare ( x_a ) ) #NEWLINE# assert ( t . c . x == 5 ) . compare ( ( x_a == 5 ) ) #NEWLINE# assert ( not ( t . c . y == 5 ) . compare ( ( x_a == 5 ) ) ) #NEWLINE# s = select ( [ t ] ) #NEWLINE# x_p = s . c . x #NEWLINE# assert ( not x_a . compare ( x_p ) ) #NEWLINE# assert ( not t . c . x . compare ( x_p ) ) #NEWLINE# x_p_a = x_p . _annotate ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# assert x_p_a . compare ( x_p ) #NEWLINE# assert x_p . compare ( x_p_a ) #NEWLINE# assert ( not x_p_a . compare ( x_a ) )