pike.git / lib / modules / testsuite.in

version» Context lines:

pike.git/lib/modules/testsuite.in:1: - dnl $Id: testsuite.in,v 1.11 2003/01/02 01:42:29 nilsson Exp $ + dnl $Id: testsuite.in,v 1.12 2003/01/15 14:47:47 nilsson Exp $      dnl - Array    - dnl Array.diff_longest_sequence + 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 }), +  ({ 9, 7, 8, 4, 5, 6, 0, 1, 2, 3 })), +  ({ ({ ({}), ({ 0, 1, 2, 3 }), +  ({ 4, 5, 6, 7, 8, 9 }) }), +  ({ ({ 9, 7, 8, 4, 5, 6 }), +  ({ 0, 1, 2, 3 }), ({}) }) })) + test_equal(Array.diff("qadfgoksdfäojerjgöohjgdgkm"/"", +  "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"/"", ({ "/" }) }) })) +  + 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));
pike.git/lib/modules/testsuite.in:92:   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 (note that the results would be different for a really optimal diff3) + test_equal(Array.diff3(({}),({"a","c"}),({"b","y"})), +  ({({({ })}), +  ({({"a","c"})}), +  ({({"b","y"})})})) + test_equal(Array.diff3(({"a"}),({"a","b"}),({"b"})), +  ({({({"a"}),({ })}), +  ({({"a"}),({"b"})}), +  ({({ }),({"b"})})})) + test_equal(Array.diff3(({"a"}),({"a","c"}),({"b"})), +  ({({({"a"}),({ })}), +  ({({"a"}),({"c"})}), +  ({({ }),({"b"})})})) + test_equal(Array.diff3(({"a","d"}),({"a","d"}),({"a","b"})), +  ({({({"a"}),({"d"})}), +  ({({"a"}),({"d"})}), +  ({({"a"}),({"b"})})})) + test_equal(Array.diff3(({"a","b"}),({"b"}),({"c","b"})), +  ({({({"a"}),({"b"})}), +  ({({ }),({"b"})}), +  ({({"c"}),({"b"})})})) + dnl The following is not optimal. + test_equal(Array.diff3(({"a","b"}),({"b"}),({"b","b"})), +  ({({({"a"}),({"b"}),({ })}), +  ({({ }),({"b"}),({ })}), +  ({({ }),({"b"}),({"b"})})})) + test_equal(Array.diff3(({"a","c","d"}),({"a","d","d"}),({"a","b"})), +  ({({({"a"}),({"c"}),({"d"}),({ })}), +  ({({"a"}),({ }),({"d"}),({"d"})}), +  ({({"a"}),({"b"}),({ }),({ })})})) + test_equal(Array.diff3(({"a","b","c"}),({"b","e","c"}),({"b","e","c"})), +  ({({({"a"}),({"b"}),({ }),({"c"})}), +  ({({ }),({"b"}),({"e"}),({"c"})}), +  ({({ }),({"b"}),({"e"}),({"c"})})})) + test_equal(Array.diff3(({"a","b","x"}),({"y","b","c","x"}),({"y","c","a"})), +  ({({({"a"}),({"b"}),({ }),({"x"})}), +  ({({"y"}),({"b"}),({"c"}),({"x"})}), +  ({({"y"}),({ }),({"c"}),({"a"})})})) + test_equal(Array.diff3(({"y","b","c","x"}),({"y","c","a"}),({"a","b","x"})), +  ({({({"y"}),({"b"}),({"c"}),({"x"})}), +  ({({"y"}),({ }),({"c"}),({"a"})}), +  ({({"a"}),({"b"}),({ }),({"x"})})})) + test_equal(Array.diff3(({"y","b","c","x"}),({"a","b","x"}),({"y","c","a"})), +  ({({({"y"}),({"b"}),({"c"}),({"x"})}), +  ({({"a"}),({"b"}),({ }),({"x"})}), +  ({({"y"}),({ }),({"c"}),({"a"})})})) + test_equal(Array.diff3(({"a","a","b","b"}),({"b","b","c","c"}),({"c","c","a","a"})), +  ({({({"a","a"}),({"b","b"}),({ }),({ })}), +  ({({ }),({"b","b"}),({"c","c"}),({ })}), +  ({({ }),({ }),({"c","c"}),({"a","a"})})})) + dnl The following is not optimal. + test_equal(Array.diff3(({"a","x","b","c"}),({"b","x","c"}),({"b","x","c"})), +  ({({({"a","x"}),({"b"}),({ }),({"c"})}), +  ({({ }),({"b"}),({"x"}),({"c"})}), +  ({({ }),({"b"}),({"x"}),({"c"})})})) + test_equal(Array.diff3(({"x","x","a","x"}),({"a","x","b","x"}),({"a","x","b","x"})), +  ({({({"x","x"}),({"a","x"}),({ })}), +  ({({ }),({"a","x"}),({"b","x"})}), +  ({({ }),({"a","x"}),({"b","x"})})})) + test_equal(Array.diff3(({"a","a","b"}),({"b","c"}),({"c","a","a"})), +  ({({({ }),({ }),({"a","a"}),({"b"})}), +  ({({"b"}),({"c"}),({ }),({ })}), +  ({({ }),({"c"}),({"a","a"}),({ })})})) + test_equal(Array.diff3(({"x","x","x","a"}),({"y","b"}),({"x","x","x","c"})), +  ({({({"x","x","x"}),({"a" })}), +  ({({ }),({"y","b"})}), +  ({({"x","x","x"}),({"c" })})})) + test_equal(Array.diff3(({"a","x","x","x","a"}),({"b","y","y","b"}),({"c","x","x","x","c"})), +  ({({({"a" }),({"x","x","x"}),({"a"})}), +  ({({"b","y","y","b"}),({ }),({ })}), +  ({({"c" }),({"x","x","x"}),({"c"})})})) + test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","d"}),({"a","y","y","y"})), +  ({({({"a"}),({"b","c" }),({"d"})}), +  ({({ }),({"x","x","x"}),({"d"})}), +  ({({"a"}),({"y","y","y"}),({ })})})) + test_equal(Array.diff3(({"a","b","c","d"}),({"a","x","x","d"}),({"a","y","y","y"})), +  ({({({"a"}),({"b","c" }),({"d"})}), +  ({({"a"}),({"x","x" }),({"d"})}), +  ({({"a"}),({"y","y","y"}),({ })})})) + test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","b"}),({"a","y","y","y"})), +  ({({({"a" }),({"b"}),({"c","d" })}), +  ({({"x","x","x"}),({"b"}),({ })}), +  ({({"a" }),({ }),({"y","y","y"})})})) + test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","c"}),({"a","y","y","y"})), +  ({({({"a"}),({"b" }),({"c"}),({"d"})}), +  ({({ }),({"x","x","x"}),({"c"}),({ })}), +  ({({"a"}),({"y","y","y"}),({ }),({ })})})) + test_equal(Array.diff3(({"a","b","b","c","d"}),({"z","a","b","b","x"}),({"z","b","c","x"})), +  ({({({ }),({"a"}),({"b"}),({"b"}),({"c"}),({"d"})}), +  ({({"z"}),({"a"}),({"b"}),({"b"}),({ }),({"x"})}), +  ({({"z"}),({ }),({"b"}),({ }),({"c"}),({"x"})})})) + test_equal(Array.diff3(({"a","b","c","d"}),({"b","a","c","c"}),({"b","b","d","d","a"})), +  ({({({"a"}),({"b"}),({"c"}),({"d"}),({ }),({ }),({ })}), +  ({({ }),({"b"}),({ }),({ }),({ }),({"a"}),({"c","c"})}), +  ({({ }),({"b"}),({"b"}),({"d"}),({"d"}),({"a"}),({ })})})) + dnl The following is not optimal. + test_equal(Array.diff3(({"a"}),({"b","a"}),({"a","b","a"})), +  ({({({ }),({"a"}),({ })}), +  ({({"b"}),({"a"}),({ })}), +  ({({ }),({"a"}),({"b","a"})})})) + dnl The following is not optimal. + test_equal(Array.diff3(({"a","c"}),({"b","a","c"}),({"a","c","b","a","c"})), +  ({({({ }),({"a","c"}),({ })}), +  ({({"b"}),({"a","c"}),({ })}), +  ({({ }),({"a","c"}),({"b","a","c"})})})) + dnl The following is not optimal. + test_equal(Array.diff3(({"a","d"}),({"b","a","c"}),({"a","c","b","a","c"})), +  ({({({ }),({"a"}),({"d" }),({ })}), +  ({({"b"}),({"a"}),({ }),({"c"})}), +  ({({ }),({"a"}),({"c","b","a"}),({"c"})})})) + dnl The following is not optimal. + test_equal(Array.diff3(({"a","a"}),({"b","a","d","a"}),({"a","a","b","a","a"})), +  ({({({ }),({"a"}),({ }),({"a"}),({ })}), +  ({({"b"}),({"a"}),({"d"}),({"a"}),({ })}), +  ({({ }),({"a"}),({ }),({"a"}),({"b","a","a"})})})) + test_equal(Array.diff3(({"a"}),({"a","b"}),({"b","a"})), +  ({({({ }),({"a"}),({ })}), +  ({({ }),({"a"}),({"b"})}), +  ({({"b"}),({"a"}),({ })})})) + test_equal(Array.diff3(({"a","b"}),({"b","a"}),({"a"})), +  ({({({ }),({"a"}),({"b"})}), +  ({({"b"}),({"a"}),({ })}), +  ({({ }),({"a"}),({ })})})) + test_equal(Array.diff3(({"b","a"}),({"a"}),({"a","b"})), +  ({({({"b"}),({"a"}),({ })}), +  ({({ }),({"a"}),({ })}), +  ({({ }),({"a"}),({"b"})})})) + test_equal(Array.diff3(({"a","b"}),({"a"}),({"b","a"})), +  ({({({ }),({"a"}),({"b"})}), +  ({({ }),({"a"}),({ })}), +  ({({"b"}),({"a"}),({ })})})) + test_equal(Array.diff3(({"a","c"}),({"a","c","b","a"}),({"b","a","c"})), +  ({({({ }),({"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 - dnl Array.dwim_sort_func +  + 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) + 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) +    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 }) ]])