Skip to content

Commit 4b857c1

Browse files
fingolfinwilfwilson
authored andcommitted
Improve tests for ListX, SetX, SumX, ...
- fix testXfuncs to actually test ListX - test that ListX, SetX, SumX, ProductX support lists with holes
1 parent 2141f4a commit 4b857c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tst/testinstall/xfuncs.tst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
gap> START_TEST("xfuncs.tst");
33
gap> testXfuncs := function(list, args...)
44
> local set, sum, prod;
5-
> list := CallFuncList(ListX, args);
65
> set := Set(list);
76
> if IsEmpty(list) then
87
> sum := fail; prod := fail;
@@ -20,11 +19,16 @@ gap> testXfuncs([2], [2], x -> x);
2019
true
2120
gap> testXfuncs([2,3], [2,3], x -> x);
2221
true
22+
gap> testXfuncs([2,3], [2,,3], x -> x); # holes are supported
23+
true
2324
gap> testXfuncs([2,3,2], [2,3,2], x -> x);
2425
true
2526
gap> testXfuncs([ [1,1], [1,2], [1,3], [2,1], [2,2], [2,3] ],
2627
> [1,2], [1,2,3], function(x,y) return [x,y]; end);
2728
true
29+
gap> testXfuncs([ [1,1], [1,2], [1,3], [2,1], [2,2], [2,3] ],
30+
> [1,,2], [1,,2,,3], function(x,y) return [x,y]; end); # holes really are supported
31+
true
2832
gap> testXfuncs([ [ 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ], [1..2],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10], function(x...) return x; end);
2933
true
3034
gap> sumlim := function(x...) return Sum(x) < 5; end;;

0 commit comments

Comments
 (0)