diff --git a/lib/modules/testsuite.in b/lib/modules/testsuite.in index 3ce677ab1bceedcfa7cd2c9743595b52709c3676..43559c32126dabeb88284dd930a8918d0640193a 100644 --- a/lib/modules/testsuite.in +++ b/lib/modules/testsuite.in @@ -566,6 +566,13 @@ test_equal(Array.filter( ({ 1,2,3,4,5,6, }), lambda(int i) { return 1; } ), 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_eq(filter("\0\1\2", `<, 2), "\0\1") +test_equal(filter((["a":1,"b":2]), `<, 2), (["a":1])) +test_equal(filter((<0,1,2>), `<, 2), (<0,1>)) +test_any_equal(class A { constant a=1; constant b=2; }; return filter(A, `<, 2);, (["a":1])) +test_any_equal(class A { protected mixed cast(string t) { if(t=="mapping") return (["a":1,"b":2]);}}; return filter(A(), `<, 2);, (["a":1])) +test_any_equal(class A { protected mixed cast(string t) { if(t=="array") return ({1,2,3});}}; return filter(A(), `<, 2);, ({1})) +test_any_equal(class A { protected mixed cast(string t) { if(t=="multiset") return (<1,2,3>);}}; return filter(A(), `<, 2);, (<1>)) test_equal(Array.permute( ({ 1,2 }), 0 ), ({ 1,2 }))