pike.git / lib / modules / testsuite.in

version» Context lines:

pike.git/lib/modules/testsuite.in:1: - dnl $Id: testsuite.in,v 1.14 2003/02/26 19:43:03 mast Exp $ + dnl $Id: testsuite.in,v 1.15 2003/04/29 00:11:18 nilsson Exp $      dnl - Array      test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),    ({ 6, 7, 8, 9, 3, 4, 5, 1, 2, 0 })),    ({ ({ ({ 0, 1, 2, 3, 4, 5 }),    ({ 6, 7, 8, 9 }), ({}) }),    ({ ({}), ({ 6, 7, 8, 9 }),    ({ 3, 4, 5, 1, 2, 0 }) }) }))   test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),
pike.git/lib/modules/testsuite.in:18:    "xadfgokälojeorjgöoyjgdgkmzzz"/""),    ({ ({ ({ "q" }), "adfgok"/"", "sdf"/"", ({ "ä" }), ({}),    "oje"/"", ({}), "rjgöo"/"", ({ "h" }), "jgdgkm"/"", ({}) }),    ({ ({ "x" }), "adfgok"/"", ({}), ({ "ä" }), ({ "l" }),    "oje"/"", ({ "o" }), "rjgöo"/"", ({ "y" }), "jgdgkm"/"",    "zzz"/"" }) }))   test_equal(Array.diff("123.org"/"","http://123.org/"/""),    ({ ({ ({}), "123.org"/"", ({}) }),    ({ "http://"/"", "123.org"/"", ({ "/" }) }) }))    + dnl Array.diff_compare_table +    test_equal(Array.longest_ordered_sequence("dfgaokäpojghadjjioijrgxcvb"/""),    ({ 0, 1, 2, 10, 11, 16, 18, 19, 20, 22 }));    - 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)) ]],    [[ ({ ({ ({0,1}), ({2,3}), ({ }) }),    ({ ({ }), ({2,3}), ({4,5}) }) }) ]])   test_any_equal([[ array x, y;    [x, y] = Array.diff(enumerate(4),enumerate(4,1,2));    return x[1] == y[1]; ]], 1)   
pike.git/lib/modules/testsuite.in:77:   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 }), 2 ), +  ({ 1,2 }))   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 }))
pike.git/lib/modules/testsuite.in:110:    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.sum_arrays( `+, ({}) ), ({}) ) + test_equal( Array.sum_arrays( `+, enumerate(5), enumerate(5)), ({0,2,4,6,8}) ) +    test_equal(Array.sort_array(({})), ({}))   test_equal([[ Array.sort_array(enumerate(9), `<) ]], [[ enumerate(9,-1,8) ]])      dnl Array.columns   dnl Array.transpose_old      dnl (note that the results would be different for a really optimal diff3)   test_equal(Array.diff3(({}),({"a","c"}),({"b","y"})),    ({({({ })}),    ({({"a","c"})}),
pike.git/lib/modules/testsuite.in:260:    ({({({ }),({"a","c"}),({ })}),    ({({ }),({"a","c"}),({"b","a"})}),    ({({"b"}),({"a","c"}),({ })})}))   test_equal(Array.diff3(({"a","c","b","a"}),({"a","c"}),({"b","a","c"})),    ({({({ }),({"a","c"}),({"b","a"})}),    ({({ }),({"a","c"}),({ })}),    ({({"b"}),({"a","c"}),({ })})}))      dnl Array.diff3_old    - test_eq(Array.dwim_sort_func("1","a"), -1) - test_eq(Array.dwim_sort_func("1","1a"), -1) - test_eq(Array.dwim_sort_func("1","0a"), 1) + define(test_sort,[[ +  test_eq(Array.$1($2,$3), -1) +  test_eq(Array.$1($3,$2), 1) + ]]) +  + test_false(Array.dwim_sort_func("","")) + test_sort(dwim_sort_func,"1","a") + test_sort(dwim_sort_func,"1","1a") + test_sort(dwim_sort_func,"0a","1") + test_sort(dwim_sort_func,"1","2") + test_sort(dwim_sort_func,"2a","10")   test_eq(Array.dwim_sort_func("1","1"), 0)   test_eq(Array.dwim_sort_func("1","01"), 0) - test_eq(Array.dwim_sort_func("1","2"), -1) - test_eq(Array.dwim_sort_func("10","2a"), 1) +     -  + test_false(Array.lyskom_sort_func("","")) + test_sort(lyskom_sort_func,"a","b") + test_false(Array.lyskom_sort_func("a","a")) + test_false(Array.lyskom_sort_func("Foo (bar)","foo (really!)")) +    dnl Array.lyskom_sort_func - dnl Array.flatten +     -  + test_eq( Array.flatten( ({}) ), ({}) ) + test_equal( Array.flatten( ({1,({2,({3,({4}),({}),5})}),({({}),({6})})})), +  ({1,2,3,4,5,6}) ) + test_equal( Array.flatten( ({ 1,({2,3}),4,({2,3}),5 }) ), ({1,2,3,4,2,3,5}) ) + test_any_equal([[ +  array a=({1,2,3}); +  a[1]=a; +  return Array.flatten(a); + ]], ({1,3})) + test_any_equal([[ +  array a=({1,({2,3}),({4,5}),({2,3})}); +  a[2][1]=a; +  return Array.flatten(a); + ]], ({1,2,3,4,2,3})) +    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!" ]])   
pike.git/lib/modules/testsuite.in:603:    array x = ({ "x", "a", "-b" });    opt(x, ({ "y", Getopt.HAS_ARG, "-b" }), 1, 1);    return x;   ]],[[ ({ "x", "a", "-b" }) ]])      dnl cleanup   test_do( master()->environment=getopt_env; )   test_do( add_constant("getopt_env"); )   test_do( add_constant("opt"); )    + dnl - Int +  + test_eq( Int.parity(0), 0 ) + test_eq( Int.parity(1), 1 ) + test_eq( Int.parity(2), 1 ) + test_eq( Int.parity(3), 0 ) + test_eq( Int.parity(4), 1 ) + test_eq( Int.parity(6), 0 ) + test_eq( Int.parity(7), 1 ) +    dnl - Mapping   dnl Mapping.delete   dnl Mapping.Iterator      dnl - Multiset   dnl Multiset.Iterator