pike.git / lib / modules / testsuite.in

version» Context lines:

pike.git/lib/modules/testsuite.in:1: - dnl $Id: testsuite.in,v 1.3 2002/10/14 16:09:43 jhs Exp $ + dnl $Id: testsuite.in,v 1.4 2002/10/16 00:00:07 nilsson Exp $      dnl - Array      dnl Array.diff_longest_sequence   dnl Array.diff_compare_table   dnl Array.longest_ordered_sequence   dnl Array.interleave_array   dnl Array.sort      test_equal([[ Array.diff(enumerate(4),enumerate(4,1,2)) ]],
pike.git/lib/modules/testsuite.in:14:   test_any_equal([[ array x, y;    [x, y] = Array.diff(enumerate(4),enumerate(4,1,2));    return x[1] == y[1]; ]], 1)      test_equal(Array.everynth("0123456789"/""),    ({ "0", "2", "4", "6", "8"}))   test_equal(Array.everynth("0123456789"/"",3),    ({ "0", "3", "6", "9"}))   test_equal(Array.everynth("0123456789"/"",3,4),    ({ "4", "7"})) + test_equal(Array.everynth(({})),({}))      test_equal(Array.splice(({7,8,99}),({"h","h",99})),    ({7,"h",8,"h",99,99}))   test_equal(Array.splice(({7,8}),({"h","h",99})),    ({7,"h",8,"h"}))   test_equal(Array.splice(({7,8,99}),({"h","h",99}),({"g",({"fg"}),97})),    ({7,"h","g",8,"h",({"fg"}),99,99,97}))   test_equal(Array.splice(({7,"foo"})),    ({7,"foo"}))   test_equal(Array.splice(),
pike.git/lib/modules/testsuite.in:37:      test_equal(Array.transpose( ({ ({ 1,2,3}), ({4,5,6}) }) ),    ({ ({1,4}), ({2,5}), ({3,6}) }))   test_equal([[Array.transpose(({catch{throw(({""}));},({1,2})[1..]}))]],    [[ ({ ({ "", 2 }) }) ]])      test_equal(Array.uniq( ({ 1,1,2,2,3,3,4,1,2,3,3,2,1,2,1 }) ),    ({1,2,3,4}))   test_equal(Array.uniq( ({ "a",5,1.0,5,"b","a" }) ),    ({"a",5,1.0,"b"})) + test_equal(Array.uniq( ({}) ), ({}))      test_equal(Array.filter( ({ 1,2,3,4,5,6, }), lambda(int i) { return 0; } ),    ({}))   test_equal(Array.filter( ({ 1,2,3,4,5,6, }), lambda(int i) { return 1; } ),    ({1,2,3,4,5,6}))   test_equal(Array.filter( ({ 1,2,3,4,5,6, }), lambda(int i) { return i%2; } ),    ({1,3,5})) -  + test_equal([[ Array.filter( ({}), lambda(int i) { return 1; })]], ({}))      test_equal(Array.permute( ({ 1,2 }), 0 ),    ({ 1,2 }))   test_equal(Array.permute( ({ 1,2 }), 1 ),    ({ 2,1 }))   test_equal(Array.permute( ({ 1,2,3,4,5,6,7,8,9,10 }), 3628800),    ({ 1,2,3,4,5,6,7,8,9,10 })) -  + test_equal(Array.permute( ({}), 1 ), ({}))    -  + test_equal(Array.enumerate(0), ({})) + test_equal(Array.enumerate(1), ({ 0 }))   test_equal(Array.enumerate(5), ({ 0,1,2,3,4 }))   test_equal(Array.enumerate(5,2), ({ 0,2,4,6,8 }))   test_equal(Array.enumerate(5,2,7), ({ 7,9,11,13,15 }))   test_equal(Array.enumerate(5,2,7,`-), ({ 7,5,3,1,-1 }))      test_eq([[ Array.reduce(`>>, ({})) ]], 0)   test_eq([[ Array.reduce(`==, ({}), 1) ]], 1)   test_eq([[ Array.reduce(`<<, ({1,2,3,4,5})) ]], 1<<14)      test_eq([[ Array.rreduce(`>>, ({})) ]], 0)   test_eq([[ Array.rreduce(`==, ({}), 1) ]], 1)   test_eq([[ Array.rreduce(`<<, ({4,3,2,1})) ]], 1125899906842624)    -  + test_equal(Array.shuffle(({})), ({})) + test_equal(Array.shuffle(({1})), ({1}))   test_any([[    random_seed(4711);    array b = Array.shuffle(Array.enumerate(1000));    random_seed(4711);    // There is a chance in 1000! (aprox. 4E2568) that this fails of    // natural causes.    return equal(b, Array.shuffle(Array.enumerate(1000))) &&    !equal(Array.enumerate(1000),b);   ]], 1);   test_true( equal(Array.enumerate(1000),sort(Array.shuffle(Array.enumerate(1000)))) )      dnl Array.search_array   dnl Array.sum_arrays    -  + test_equal(Array.sort_array(({})), ({}))   test_equal([[ Array.sort_array(enumerate(9), `<) ]], [[ enumerate(9,-1,8) ]])      dnl Array.columns   dnl Array.transpose_old   dnl Array.diff3   dnl Array.diff3_old   dnl Array.dwim_sort_func   dnl Array.lyskom_sort_func   dnl Array.flatten    -  + test_eq(Array.sum(({})),0)   test_eq(Array.sum((array(int))"157"), 157)   test_eq([[ Array.sum(enumerate(12345)) ]],    [[ Array.reduce(`+, enumerate(12345)) ]]) -  + test_eq(Array.sum( "abcdefgh"/2.5 ), "abcdefgh") + test_equal([[ Array.sum( ({ ({ 1,2,3 }), ({ 4,5 }) }) )]],[[ ({ 1,2,3,4,5 }) ]])    -  + test_equal(Array.uniq2(({})), ({}))   test_equal([[ Array.uniq2("AAAAAAAAAAAHHHHAAA!!!!"/1)*"" ]], [[ "AHA!" ]])      test_equal([[ Array.arrayify( ({1,2,3}) ) ]],[[ ({1,2,3}) ]])   test_equal([[ Array.arrayify( 1 ) ]],[[ ({1}) ]])   test_equal([[ Array.arrayify( 0 ) ]],[[ ({0}) ]])   test_equal([[ Array.arrayify( UNDEFINED ) ]],[[ ({}) ]])      dnl Array.oid_sort_func   dnl Array.greedy_diff    -  + test_equal( Array.count(({})), ([]) )   test_eq( Array.count((multiset)("All your Pike are belong to us!"/1), " "), 6 )   test_eq( Array.count("...and there was much rejoicing."/1, "."), 4 )   test_eq([[Array.count((["An":"eye", "for":4, "an":"eye"]), "eye")]], 2 )   test_equal([[ Array.count((["An":"eye", "for":4, "an":"eye"])) ]],    [[ ([ "eye":2, 4:1 ]) ]])      test_equal(Array.common_prefix(({ "soliloquise"/1 })), "soliloquise"/1)   test_equal(Array.common_prefix(({ "muzzle"/1, "muzzy"/1 })), "muzz"/1)   test_equal(Array.common_prefix(({ "labyrinth"/1, "diatom"/1 })), ({}))   test_equal(Array.common_prefix(({ "abc"/1, "abc"/1, "abc"/1 })), "abc"/1)