tests/spec/unit/general/assert_bad_1.mzn
raw| 1 | /*** |
| 2 | !Test |
| 3 | expected: !Error |
| 4 | type: AssertionError |
| 5 | ***/ |
| 6 | |
| 7 | array [1..10] of int: a = |
| 8 | [i | i in 1..10]; |
| 9 | |
| 10 | % Predicate style assertion. |
| 11 | % |
| 12 | constraint assert(forall (i in 1..9) (a[i] > a[i + 1]), "a not decreasing"); |
| 13 | |
| 14 | var 1..10: x; |
| 15 | |
| 16 | constraint a[x] = max(a); |
| 17 | |
| 18 | solve satisfy; |
| 19 | |
| 20 | output ["x = ", show(x), ";"]; |