polserver/testsuite/escript/array/array20.src

31 lines
620 B
Text
Raw Permalink Normal View History

var a := { 1, 2, 3, 5 };
a.sorted_insert( 4 );
print( a );
print( "reverse" );
a := { 1, 2, 3, 5 };
a.reverse();
a.sorted_insert( 4, 0, 1 );
print( a );
a := { 1, 2, 3, 5 };
a.reverse();
print( "wrong" );
a.sorted_insert( 4, 0, 0 );
print( a );
print( "sub index" );
a := { { 1, 5 }, { 2, 4 }, { 3, 3 }, { 5, 1 } };
a.sorted_insert( { 4, 2 }, 1 );
print( a );
print( "sub index reverse" );
a := { { 1, 5 }, { 2, 4 }, { 3, 3 }, { 5, 1 } };
a.sorted_insert( { 4, 2 }, 2, 1 );
print( a );
print( "sub index reverse wrong" );
a := { { 1, 5 }, { 2, 4 }, { 3, 3 }, { 5, 1 } };
a.sorted_insert( { 4, 2 }, 2 );
print( a );