diff --git a/src/testsuite.in b/src/testsuite.in index fa431530683cd20ed30c393d259c9e51efb61e80..01e426033b290a153818e9021b628b6c05e9dd49 100644 --- a/src/testsuite.in +++ b/src/testsuite.in @@ -1,4 +1,4 @@ -test_true([["$Id: testsuite.in,v 1.636 2003/04/10 19:48:13 nilsson Exp $"]]); +test_true([["$Id: testsuite.in,v 1.637 2003/04/27 17:51:58 mast Exp $"]]); // This triggered a bug only if run sufficiently early. test_compile_any([[#pike 7.2]]) @@ -3197,8 +3197,6 @@ class p2 { int foo() { return 2; } }; class c1 { inherit p1; inherit p2; }; return c1()->foo();]],2) -test_any([[class foo { int x=random(100); int `<(object o) { return x < o->x; } }; array(object) o=allocate(100,foo)(); sort(o); for(int e=1;e<100;e++) if(o[e-1]->x > o[e]->x) return e; return -1;]],-1) - test_any([[ mixed ret=({}); int a, b = 3; @@ -9006,6 +9004,35 @@ test_equal([[lambda() {array(int) a=({1,2,3,4}), b=a+({}); sort(({4,3,2,1}),a,b) dnl test_equal([[sort("a,A,�,�,�,*A,[A"/",")]],[["*A,A,[A,a,�,�,�"/","]]) test_equal(sort(({})),({})) test_equal(sort(({1.0,2.0,4.0,3.0})),({1.0,2.0,3.0,4.0})) +test_any_equal([[ + // sort() on one arg should be stable. + class C (int id) {int `< (mixed x) {return 0;}}; + return sort (({C(2), C(6), C(1), C(4), C(3), C(5)}))->id; +]], ({2, 6, 1, 4, 3, 5})) +test_any_equal([[ + // sort() on several args should be stable. + array a = ({2, 6, 1, 4, 3, 5}); + sort (({1, 1, 1, 1, 1, 1}), a); + return a; +]], ({2, 6, 1, 4, 3, 5})) +test_any_equal([[ + // sort() on several args should be stable. + array a = ({2, 6, 1, 4, 3, 5}); + sort (({1, 2, 1, 2, 1, 2}), a); + return a; +]], ({2, 1, 3, 6, 4, 5})) +test_any([[ + class foo { + int x=random(100); + int `<(object o) {return x < o->x;} + }; + array(object) o=allocate(100,foo)(); + sort(o); + for(int e=1;e<100;e++) + if(o[e-1]->x > o[e]->x) + return e; + return -1; +]],-1) dnl missing tests for objects, arrays, multisets and mappings // - sprintf