1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
#
# Tests for functions defined in src/lists.c
#
gap> START_TEST("kernel/lists.tst");
# IsHomogListDefault
# TODO: need to create custom list type to test this
# IsTableListDefault
gap> IsTable([true,false,true]);
false
# IsPossListDefault
# TODO: need to create custom list type to test this
#
gap> SET_FILTER_LIST(fail,fail);
Error, <oper> must be an operation
#
gap> enum:=Enumerator(Integers);
<enumerator of Integers>
gap> IsList(enum);
true
gap> Length(enum);
infinity
gap> IsSmallList(enum);
false
#
gap> ISB_LIST(1,2);
Error, IsBound: <list> must be a list (not a integer)
gap> ISB_LIST([1],1);
true
gap> ISB_LIST([1],2);
false
gap> ISB_LIST([1],[1,2]);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `IsBound[]' on 2 arguments
gap> ISB_LIST([[1,2],[3,4]],[1,2]);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `IsBound[]' on 2 arguments
#
gap> UNB_LIST(1,2);
Error, Unbind: <list> must be a list (not a integer)
gap> UNB_LIST([1],1);
gap> UNB_LIST([1],2);
#
gap> ELM0_LIST([1],1);
1
gap> ELM0_LIST([1],2);
fail
gap> ELM0_LIST(1,2);
Error, List Element: <list> must be a list (not a integer)
#
gap> ELM_LIST([1],1);
1
gap> ELM_LIST([1],2);
Error, List Element: <list>[2] must have an assigned value
gap> ELM_LIST(1,2);
Error, List Element: <list> must be a list (not a integer)
#
gap> ELMS_LIST(1,1);
Error, List Elements: <positions> must be a dense list of positive integers
gap> ELMS_LIST([1],1);
Error, List Elements: <positions> must be a dense list of positive integers
gap> ELMS_LIST([1],[2]);
Error, List Elements: <list>[2] must have an assigned value
gap> ELMS_LIST([1,2,3],[1,3]);
[ 1, 3 ]
gap> ELMS_LIST([1],[1,2^100,3]);
Error, List Elements: position is too large for this type of list
gap> ELMS_LIST([1,2,3],[1..4]);
Error, List Elements: <list>[4] must have an assigned value
gap> ELMS_LIST([1,2,3],[4..5]);
Error, List Elements: <list>[4] must have an assigned value
gap> ELMS_LIST([1,2,3],[1..2]);
[ 1, 2 ]
#
gap> ELMS_LIST_DEFAULT(1,1);
Error, Length: <list> must be a list (not a integer)
gap> ELMS_LIST_DEFAULT([1],1);
Error, Length: <list> must be a list (not a integer)
gap> ELMS_LIST_DEFAULT([1],[2]);
Error, List Elements: <list>[2] must have an assigned value
gap> ELMS_LIST_DEFAULT([1,2,3],[1,3]);
[ 1, 3 ]
gap> ELMS_LIST_DEFAULT([1],[1,2^100,3]);
Error, List Elements: position is too large for this type of list
gap> ELMS_LIST_DEFAULT([1,2,3],[1..4]);
Error, List Elements: <list>[4] must have an assigned value
gap> ELMS_LIST_DEFAULT([1,2,3],[4..5]);
Error, List Elements: <list>[4] must have an assigned value
gap> ELMS_LIST_DEFAULT([1,2,3],[1..2]);
[ 1, 2 ]
#
gap> ASS_LIST(1,1,1);
Error, List Assignment: <list> must be a list (not a integer)
gap> l:=[];; ASS_LIST(l,1,1); l;
[ 1 ]
#
gap> ASSS_LIST([1],[1],1);
Error, List Assignment: <rhss> must be a dense list
gap> ASSS_LIST([1],1,[1]);
Error, List Assignment: <positions> must be a dense list of positive integers
gap> ASSS_LIST(1,[1],[1]);
Error, List Assignments: <list> must be a list (not a integer)
gap> l:=[];; ASSS_LIST(l,[1],[1]); l;
[ 1 ]
#
gap> ASSS_LIST_DEFAULT([1],[1],1);
Error, List Assignment: <rhss> must be a dense list
gap> ASSS_LIST_DEFAULT([1],1,[1]);
Error, List Assignment: <positions> must be a dense list of positive integers
gap> ASSS_LIST_DEFAULT(1,[1],[1]);
Error, List Assignment: <list> must be a list (not a integer)
gap> l:=[];; ASSS_LIST_DEFAULT(l,[1],[1]); l;
[ 1 ]
#
gap> STOP_TEST("kernel/lists.tst", 1);
|