| 1 |
/*** |
| 2 |
!Test |
| 3 |
solvers: [gecode] |
| 4 |
expected: !Result |
| 5 |
solution: !Solution |
| 6 |
***/ |
| 7 |
|
| 8 |
any: x1::output = select_from_index_1([|1,2,3|4,5,6|], {1}); |
| 9 |
any: x2::output = select_from_index_1([|1,2,3|4,5,6|], {2}); |
| 10 |
any: x3::output = select_from_index_2([|1,2,3|4,5,6|], {1}); |
| 11 |
any: x4::output = select_from_index_2([|1,2,3|4,5,6|], {2}); |
| 12 |
any: x5::output = select_from_index_2(array2d(1..2,3..5,[|1,2,3|4,5,6|]), {}); |
| 13 |
any: x6::output = select_from_index_2(array2d(1..2,3..5,[|1,2,3|4,5,6|]), {3,5}); |
| 14 |
|
| 15 |
constraint assert(array1d(x1) = [1,2,3], "Error"); |
| 16 |
constraint assert(array1d(x2) = [4,5,6], "Error"); |
| 17 |
constraint assert(array1d(x3) = [1,4], "Error"); |
| 18 |
constraint assert(array1d(x4) = [2,5], "Error"); |
| 19 |
constraint assert(array1d(x5) = [], "Error"); |
| 20 |
constraint assert(array1d(x6) = [1,3,4,6], "Error"); |
| 21 |
|
| 22 |
output ["OK"]; |