Skip to content

Commit d228f97

Browse files
committed
Start adding tests.
1 parent 231efbd commit d228f97

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

test/assets/puzzle.fzn

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
% Excerpt of Google OR-Tools (https://github.com/google/or-tools/)
2+
% License: Apache 2.0 (https://github.com/google/or-tools/blob/stable/LICENSE-2.0.txt)
3+
% Original file: https://github.com/google/or-tools/blob/stable/examples/flatzinc/puzzle1.fzn
4+
array [1..16] of int: clues = [5, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 8, 0, 7, 0, 0];
5+
array [1..4] of int: colsums = [24, 18, 31, 31];
6+
array [1..2] of int: diagsums = [24, 24];
7+
array [1..4] of int: rowsums = [22, 26, 31, 25];
8+
array [1..16] of var 1..9: x :: output_array([1..4, 1..4]);
9+
constraint int_eq(5, x[1]);
10+
constraint int_eq(7, x[14]);
11+
constraint int_eq(8, x[7]);
12+
constraint int_eq(8, x[12]);
13+
constraint int_lin_eq([1, 1, 1, 1], [x[1], x[2], x[3], x[4]], 22);
14+
constraint int_lin_eq([1, 1, 1, 1], [x[1], x[5], x[9], x[13]], 24);
15+
constraint int_lin_eq([1, 1, 1, 1], [x[1], x[6], x[11], x[16]], 24);
16+
constraint int_lin_eq([1, 1, 1, 1], [x[2], x[6], x[10], x[14]], 18);
17+
constraint int_lin_eq([1, 1, 1, 1], [x[3], x[7], x[11], x[15]], 31);
18+
constraint int_lin_eq([1, 1, 1, 1], [x[4], x[7], x[10], x[13]], 24);
19+
constraint int_lin_eq([1, 1, 1, 1], [x[4], x[8], x[12], x[16]], 31);
20+
constraint int_lin_eq([1, 1, 1, 1], [x[5], x[6], x[7], x[8]], 26);
21+
constraint int_lin_eq([1, 1, 1, 1], [x[9], x[10], x[11], x[12]], 31);
22+
constraint int_lin_eq([1, 1, 1, 1], [x[13], x[14], x[15], x[16]], 25);
23+
solve satisfy;

test/parsing.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@testset "Parsing FlatZinc output format" begin
2+
3+
end

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const CP = ConstraintProgrammingExtensions
1111
const COIT = CP.Test
1212

1313
@testset "Chuffed" begin
14+
include("parsing.jl")
15+
1416
# include("api_java.jl")
1517
# include("MOI.jl")
1618
end

0 commit comments

Comments
 (0)