#NEWLINE# def test_mergesort_2( ) : #NEWLINE# #INDENT# table1 = ( ( 'foo' , 'bar' ) , ( 'A' , 9 ) , ( 'C' , 2 ) , ( 'D' , 10 ) , ( 'A' , 6 ) , ( 'F' , 1 ) ) #NEWLINE# table2 = ( ( 'foo' , 'baz' ) , ( 'B' , 3 ) , ( 'D' , 10 ) , ( 'A' , 10 ) , ( 'F' , 4 ) ) #NEWLINE# expect = sort ( cat ( table1 , table2 ) , key = 'foo' ) #NEWLINE# actual = mergesort ( table1 , table2 , key = 'foo' ) #NEWLINE# ieq ( expect , actual ) #NEWLINE# ieq ( expect , actual ) #NEWLINE# actual = mergesort ( sort ( table1 , key = 'foo' ) , sort ( table2 , key = 'foo' ) , key = 'foo' , presorted = True ) #NEWLINE# ieq ( expect , actual ) #NEWLINE# ieq ( expect , actual )