diff options
author | 2020-11-04 01:33:58 -0500 | |
---|---|---|
committer | 2020-11-04 01:33:58 -0500 | |
commit | a20af4d0dbf5eab84ee271d426528aabb5a8ac3b (patch) | |
tree | a9ab772ee313125aaf3a941d66e131b408d949ba /Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/RelationTest.xtend | |
parent | changes in settings of measurements (diff) | |
parent | merge with current master, comment numerical solver related logging (diff) | |
download | VIATRA-Generator-a20af4d0dbf5eab84ee271d426528aabb5a8ac3b.tar.gz VIATRA-Generator-a20af4d0dbf5eab84ee271d426528aabb5a8ac3b.tar.zst VIATRA-Generator-a20af4d0dbf5eab84ee271d426528aabb5a8ac3b.zip |
fix merging issue
Diffstat (limited to 'Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/RelationTest.xtend')
-rw-r--r-- | Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/RelationTest.xtend | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/RelationTest.xtend b/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/RelationTest.xtend new file mode 100644 index 00000000..5527fbaa --- /dev/null +++ b/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/RelationTest.xtend | |||
@@ -0,0 +1,126 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests.interval | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.interval.Interval | ||
4 | import java.util.Collection | ||
5 | import org.junit.Assert | ||
6 | import org.junit.Test | ||
7 | import org.junit.runner.RunWith | ||
8 | import org.junit.runners.Parameterized | ||
9 | import org.junit.runners.Parameterized.Parameter | ||
10 | import org.junit.runners.Parameterized.Parameters | ||
11 | |||
12 | import static hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.interval.Interval.* | ||
13 | |||
14 | @RunWith(Parameterized) | ||
15 | class RelationTest { | ||
16 | @Parameters(name = "{index}: {0} <> {1}") | ||
17 | static def Collection<Object[]> data() { | ||
18 | #[ | ||
19 | #[EMPTY, EMPTY, true, false, true, false, EMPTY], | ||
20 | #[EMPTY, between(1, 2), true, false, true, false, between(1, 2)], | ||
21 | #[between(1, 2), EMPTY, true, false, true, false, between(1, 2)], | ||
22 | #[upTo(1), upTo(0), false, true, false, true, upTo(1)], | ||
23 | #[upTo(1), upTo(1), false, true, false, true, upTo(1)], | ||
24 | #[upTo(1), upTo(2), false, true, false, true, upTo(2)], | ||
25 | #[upTo(1), above(0), false, true, false, true, UNBOUNDED], | ||
26 | #[upTo(1), above(1), false, true, false, true, UNBOUNDED], | ||
27 | #[upTo(1), above(2), false, false, true, true, UNBOUNDED], | ||
28 | #[upTo(1), between(-1, -1), false, true, false, true, upTo(1)], | ||
29 | #[upTo(1), between(-1, 0), false, true, false, true, upTo(1)], | ||
30 | #[upTo(1), between(-1, 1), false, true, false, true, upTo(1)], | ||
31 | #[upTo(1), between(-1, 2), false, true, false, true, upTo(2)], | ||
32 | #[upTo(1), between(1, 1), false, true, false, true, upTo(1)], | ||
33 | #[upTo(1), between(1, 2), false, true, false, true, upTo(2)], | ||
34 | #[upTo(1), between(2, 2), false, false, true, true, upTo(2)], | ||
35 | #[upTo(1), between(2, 3), false, false, true, true, upTo(3)], | ||
36 | #[above(1), upTo(0), false, false, false, false, UNBOUNDED], | ||
37 | #[above(1), upTo(1), false, true, false, false, UNBOUNDED], | ||
38 | #[above(1), upTo(2), false, true, false, true, UNBOUNDED], | ||
39 | #[above(1), above(0), false, true, false, true, above(0)], | ||
40 | #[above(1), above(1), false, true, false, true, above(1)], | ||
41 | #[above(1), above(2), false, true, false, true, above(1)], | ||
42 | #[above(1), between(-1, -1), false, false, false, false, above(-1)], | ||
43 | #[above(1), between(-1, 0), false, false, false, false, above(-1)], | ||
44 | #[above(1), between(-1, 1), false, true, false, false, above(-1)], | ||
45 | #[above(1), between(-1, 2), false, true, false, true, above(-1)], | ||
46 | #[above(1), between(1, 1), false, true, false, false, above(1)], | ||
47 | #[above(1), between(1, 2), false, true, false, true, above(1)], | ||
48 | #[above(1), between(2, 2), false, true, false, true, above(1)], | ||
49 | #[above(1), between(2, 3), false, true, false, true, above(1)], | ||
50 | #[between(1, 1), upTo(0), false, false, false, false, upTo(1)], | ||
51 | #[between(1, 1), upTo(1), false, true, false, false, upTo(1)], | ||
52 | #[between(1, 1), upTo(2), false, true, false, true, upTo(2)], | ||
53 | #[between(1, 1), above(0), false, true, false, true, above(0)], | ||
54 | #[between(1, 1), above(1), false, true, false, true, above(1)], | ||
55 | #[between(1, 1), above(2), false, false, true, true, above(1)], | ||
56 | #[between(1, 1), between(-1, -1), false, false, false, false, between(-1, 1)], | ||
57 | #[between(1, 1), between(-1, 0), false, false, false, false, between(-1, 1)], | ||
58 | #[between(1, 1), between(-1, 1), false, true, false, false, between(-1, 1)], | ||
59 | #[between(1, 1), between(-1, 2), false, true, false, true, between(-1, 2)], | ||
60 | #[between(1, 1), between(1, 1), true, true, false, false, between(1, 1)], | ||
61 | #[between(1, 1), between(1, 2), false, true, false, true, between(1, 2)], | ||
62 | #[between(1, 1), between(2, 2), false, false, true, true, between(1, 2)], | ||
63 | #[between(1, 1), between(2, 3), false, false, true, true, between(1, 3)], | ||
64 | #[between(-1, 1), upTo(-2), false, false, false, false, upTo(1)], | ||
65 | #[between(-1, 1), upTo(-1), false, true, false, false, upTo(1)], | ||
66 | #[between(-1, 1), upTo(0), false, true, false, true, upTo(1)], | ||
67 | #[between(-1, 1), upTo(1), false, true, false, true, upTo(1)], | ||
68 | #[between(-1, 1), upTo(2), false, true, false, true, upTo(2)], | ||
69 | #[between(-1, 1), above(-2), false, true, false, true, above(-2)], | ||
70 | #[between(-1, 1), above(-1), false, true, false, true, above(-1)], | ||
71 | #[between(-1, 1), above(0), false, true, false, true, above(-1)], | ||
72 | #[between(-1, 1), above(1), false, true, false, true, above(-1)], | ||
73 | #[between(-1, 1), above(2), false, false, true, true, above(-1)], | ||
74 | #[between(-1, 1), between(-3, -2), false, false, false, false, between(-3, 1)], | ||
75 | #[between(-1, 1), between(-2, -2), false, false, false, false, between(-2, 1)], | ||
76 | #[between(-1, 1), between(-2, -1), false, true, false, false, between(-2, 1)], | ||
77 | #[between(-1, 1), between(-2, 0), false, true, false, true, between(-2, 1)], | ||
78 | #[between(-1, 1), between(-2, 1), false, true, false, true, between(-2, 1)], | ||
79 | #[between(-1, 1), between(-2, 2), false, true, false, true, between(-2, 2)], | ||
80 | #[between(-1, 1), between(-1, -1), false, true, false, false, between(-1, 1)], | ||
81 | #[between(-1, 1), between(-1, 0), false, true, false, true, between(-1, 1)], | ||
82 | #[between(-1, 1), between(-1, 1), false, true, false, true, between(-1, 1)], | ||
83 | #[between(-1, 1), between(-1, 2), false, true, false, true, between(-1, 2)], | ||
84 | #[between(-1, 1), between(0, 0), false, true, false, true, between(-1, 1)], | ||
85 | #[between(-1, 1), between(0, 1), false, true, false, true, between(-1, 1)], | ||
86 | #[between(-1, 1), between(0, 2), false, true, false, true, between(-1, 2)], | ||
87 | #[between(-1, 1), between(1, 1), false, true, false, true, between(-1, 1)], | ||
88 | #[between(-1, 1), between(1, 2), false, true, false, true, between(-1, 2)], | ||
89 | #[between(-1, 1), between(2, 2), false, false, true, true, between(-1, 2)], | ||
90 | #[between(-1, 1), between(2, 3), false, false, true, true, between(-1, 3)] | ||
91 | ] | ||
92 | } | ||
93 | |||
94 | @Parameter(0) public var Interval a | ||
95 | @Parameter(1) public var Interval b | ||
96 | @Parameter(2) public var boolean mustEqual | ||
97 | @Parameter(3) public var boolean mayEqual | ||
98 | @Parameter(4) public var boolean mustBeLessThan | ||
99 | @Parameter(5) public var boolean mayBeLessThan | ||
100 | @Parameter(6) public var Interval join | ||
101 | |||
102 | @Test | ||
103 | def void mustEqualTest() { | ||
104 | Assert.assertEquals(mustEqual, a.mustEqual(b)) | ||
105 | } | ||
106 | |||
107 | @Test | ||
108 | def void mayEqualTest() { | ||
109 | Assert.assertEquals(mayEqual, a.mayEqual(b)) | ||
110 | } | ||
111 | |||
112 | @Test | ||
113 | def void mustBeLessThanTest() { | ||
114 | Assert.assertEquals(mustBeLessThan, a.mustBeLessThan(b)) | ||
115 | } | ||
116 | |||
117 | @Test | ||
118 | def void mayBeLessThanTest() { | ||
119 | Assert.assertEquals(mayBeLessThan, a.mayBeLessThan(b)) | ||
120 | } | ||
121 | |||
122 | @Test | ||
123 | def void joinTest() { | ||
124 | Assert.assertEquals(join, a.join(b)) | ||
125 | } | ||
126 | } | ||