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/DivisionTest.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/DivisionTest.xtend')
-rw-r--r-- | Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/DivisionTest.xtend | 202 |
1 files changed, 202 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/DivisionTest.xtend b/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/DivisionTest.xtend new file mode 100644 index 00000000..3a8c0c5d --- /dev/null +++ b/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/DivisionTest.xtend | |||
@@ -0,0 +1,202 @@ | |||
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 DivisionTest { | ||
16 | @Parameters(name="{index}: {0} / {1} = {2}") | ||
17 | static def Collection<Object[]> data() { | ||
18 | #[ | ||
19 | #[EMPTY, EMPTY, EMPTY], | ||
20 | #[EMPTY, between(-1, 1), EMPTY], | ||
21 | #[between(-1, 1), EMPTY, EMPTY], | ||
22 | #[UNBOUNDED, UNBOUNDED, UNBOUNDED], | ||
23 | #[UNBOUNDED, upTo(-2), UNBOUNDED], | ||
24 | #[UNBOUNDED, upTo(0), UNBOUNDED], | ||
25 | #[UNBOUNDED, upTo(3), UNBOUNDED], | ||
26 | #[UNBOUNDED, above(-2), UNBOUNDED], | ||
27 | #[UNBOUNDED, above(0), UNBOUNDED], | ||
28 | #[UNBOUNDED, above(3), UNBOUNDED], | ||
29 | #[UNBOUNDED, between(-4, -3), UNBOUNDED], | ||
30 | #[UNBOUNDED, between(-4, 0), UNBOUNDED], | ||
31 | #[UNBOUNDED, between(-3, 4), UNBOUNDED], | ||
32 | #[UNBOUNDED, between(0, 4), UNBOUNDED], | ||
33 | #[UNBOUNDED, between(3, 4), UNBOUNDED], | ||
34 | #[UNBOUNDED, ZERO, EMPTY], | ||
35 | #[upTo(-12), UNBOUNDED, UNBOUNDED], | ||
36 | #[upTo(-12), upTo(-2), above(0)], | ||
37 | #[upTo(-12), upTo(0), above(0)], | ||
38 | #[upTo(-12), upTo(3), UNBOUNDED], | ||
39 | #[upTo(-12), above(-2), UNBOUNDED], | ||
40 | #[upTo(-12), above(0), upTo(0)], | ||
41 | #[upTo(-12), above(3), upTo(0)], | ||
42 | #[upTo(-12), between(-4, -3), above(3)], | ||
43 | #[upTo(-12), between(-4, 0), above(3)], | ||
44 | #[upTo(-12), between(-3, 4), UNBOUNDED], | ||
45 | #[upTo(-12), between(0, 4), upTo(-3)], | ||
46 | #[upTo(-12), between(3, 4), upTo(-3)], | ||
47 | #[upTo(-12), ZERO, EMPTY], | ||
48 | #[upTo(0), UNBOUNDED, UNBOUNDED], | ||
49 | #[upTo(0), upTo(-2), above(0)], | ||
50 | #[upTo(0), upTo(0), above(0)], | ||
51 | #[upTo(0), upTo(3), UNBOUNDED], | ||
52 | #[upTo(0), above(-2), UNBOUNDED], | ||
53 | #[upTo(0), above(0), upTo(0)], | ||
54 | #[upTo(0), above(3), upTo(0)], | ||
55 | #[upTo(0), between(-4, -3), above(0)], | ||
56 | #[upTo(0), between(-4, 0), above(0)], | ||
57 | #[upTo(0), between(-3, 4), UNBOUNDED], | ||
58 | #[upTo(0), between(0, 4), upTo(0)], | ||
59 | #[upTo(0), between(3, 4), upTo(0)], | ||
60 | #[upTo(0), ZERO, EMPTY], | ||
61 | #[upTo(12), UNBOUNDED, UNBOUNDED], | ||
62 | #[upTo(12), upTo(-2), above(-6)], | ||
63 | #[upTo(12), upTo(0), UNBOUNDED], | ||
64 | #[upTo(12), upTo(3), UNBOUNDED], | ||
65 | #[upTo(12), above(-2), UNBOUNDED], | ||
66 | #[upTo(12), above(0), UNBOUNDED], | ||
67 | #[upTo(12), above(3), upTo(4)], | ||
68 | #[upTo(12), between(-4, -3), above(-4)], | ||
69 | #[upTo(12), between(-4, 0), UNBOUNDED], | ||
70 | #[upTo(12), between(-3, 4), UNBOUNDED], | ||
71 | #[upTo(12), between(0, 4), UNBOUNDED], | ||
72 | #[upTo(12), between(3, 4), upTo(4)], | ||
73 | #[upTo(12), ZERO, EMPTY], | ||
74 | #[above(-12), UNBOUNDED, UNBOUNDED], | ||
75 | #[above(-12), upTo(-2), upTo(6)], | ||
76 | #[above(-12), upTo(0), UNBOUNDED], | ||
77 | #[above(-12), upTo(3), UNBOUNDED], | ||
78 | #[above(-12), above(-2), UNBOUNDED], | ||
79 | #[above(-12), above(0), UNBOUNDED], | ||
80 | #[above(-12), above(3), above(-4)], | ||
81 | #[above(-12), between(-4, -3), upTo(4)], | ||
82 | #[above(-12), between(-4, 0), UNBOUNDED], | ||
83 | #[above(-12), between(-3, 4), UNBOUNDED], | ||
84 | #[above(-12), between(0, 4), UNBOUNDED], | ||
85 | #[above(-12), between(3, 4), above(-4)], | ||
86 | #[above(-12), ZERO, EMPTY], | ||
87 | #[above(0), UNBOUNDED, UNBOUNDED], | ||
88 | #[above(0), upTo(-2), upTo(0)], | ||
89 | #[above(0), upTo(0), upTo(0)], | ||
90 | #[above(0), upTo(3), UNBOUNDED], | ||
91 | #[above(0), above(-2), UNBOUNDED], | ||
92 | #[above(0), above(0), above(0)], | ||
93 | #[above(0), above(3), above(0)], | ||
94 | #[above(0), between(-4, -3), upTo(0)], | ||
95 | #[above(0), between(-4, 0), upTo(0)], | ||
96 | #[above(0), between(-3, 4), UNBOUNDED], | ||
97 | #[above(0), between(0, 4), above(0)], | ||
98 | #[above(0), between(3, 4), above(0)], | ||
99 | #[above(0), ZERO, EMPTY], | ||
100 | #[above(12), UNBOUNDED, UNBOUNDED], | ||
101 | #[above(12), upTo(-2), upTo(0)], | ||
102 | #[above(12), upTo(0), upTo(0)], | ||
103 | #[above(12), upTo(3), UNBOUNDED], | ||
104 | #[above(12), above(-2), UNBOUNDED], | ||
105 | #[above(12), above(0), above(0)], | ||
106 | #[above(12), above(3), above(0)], | ||
107 | #[above(12), between(-4, -3), upTo(-3)], | ||
108 | #[above(12), between(-4, 0), upTo(-3)], | ||
109 | #[above(12), between(-3, 4), UNBOUNDED], | ||
110 | #[above(12), between(0, 4), above(3)], | ||
111 | #[above(12), between(3, 4), above(3)], | ||
112 | #[above(12), ZERO, EMPTY], | ||
113 | #[between(-36, -12), UNBOUNDED, UNBOUNDED], | ||
114 | #[between(-36, -12), upTo(-2), between(0, 18)], | ||
115 | #[between(-36, -12), upTo(0), above(0)], | ||
116 | #[between(-36, -12), upTo(3), UNBOUNDED], | ||
117 | #[between(-36, -12), above(-2), UNBOUNDED], | ||
118 | #[between(-36, -12), above(0), upTo(0)], | ||
119 | #[between(-36, -12), above(3), between(-12, 0)], | ||
120 | #[between(-36, -12), between(-4, -3), between(3, 12)], | ||
121 | #[between(-36, -12), between(-4, 0), above(3)], | ||
122 | #[between(-36, -12), between(-3, 4), UNBOUNDED], | ||
123 | #[between(-36, -12), between(0, 4), upTo(-3)], | ||
124 | #[between(-36, -12), between(3, 4), between(-12, -3)], | ||
125 | #[between(-36, -12), ZERO, EMPTY], | ||
126 | #[between(-36, 0), UNBOUNDED, UNBOUNDED], | ||
127 | #[between(-36, 0), upTo(-2), between(0, 18)], | ||
128 | #[between(-36, 0), upTo(0), above(0)], | ||
129 | #[between(-36, 0), upTo(3), UNBOUNDED], | ||
130 | #[between(-36, 0), above(-2), UNBOUNDED], | ||
131 | #[between(-36, 0), above(0), upTo(0)], | ||
132 | #[between(-36, 0), above(3), between(-12, 0)], | ||
133 | #[between(-36, 0), between(-4, -3), between(0, 12)], | ||
134 | #[between(-36, 0), between(-4, 0), above(0)], | ||
135 | #[between(-36, 0), between(-3, 4), UNBOUNDED], | ||
136 | #[between(-36, 0), between(0, 4), upTo(0)], | ||
137 | #[between(-36, 0), between(3, 4), between(-12, 0)], | ||
138 | #[between(-36, 0), ZERO, EMPTY], | ||
139 | #[between(-12, 36), UNBOUNDED, UNBOUNDED], | ||
140 | #[between(-12, 36), upTo(-2), between(-18, 6)], | ||
141 | #[between(-12, 36), upTo(0), UNBOUNDED], | ||
142 | #[between(-12, 36), upTo(3), UNBOUNDED], | ||
143 | #[between(-12, 36), above(-2), UNBOUNDED], | ||
144 | #[between(-12, 36), above(0), UNBOUNDED], | ||
145 | #[between(-12, 36), above(3), between(-4, 12)], | ||
146 | #[between(-12, 36), between(-4, -3), between(-12, 4)], | ||
147 | #[between(-12, 36), between(-4, 0), UNBOUNDED], | ||
148 | #[between(-12, 36), between(-3, 4), UNBOUNDED], | ||
149 | #[between(-12, 36), between(0, 4), UNBOUNDED], | ||
150 | #[between(-12, 36), between(3, 4), between(-4, 12)], | ||
151 | #[between(-12, 36), ZERO, EMPTY], | ||
152 | #[between(0, 36), UNBOUNDED, UNBOUNDED], | ||
153 | #[between(0, 36), upTo(-2), between(-18, 0)], | ||
154 | #[between(0, 36), upTo(0), upTo(0)], | ||
155 | #[between(0, 36), upTo(3), UNBOUNDED], | ||
156 | #[between(0, 36), above(-2), UNBOUNDED], | ||
157 | #[between(0, 36), above(0), above(0)], | ||
158 | #[between(0, 36), above(3), between(0, 12)], | ||
159 | #[between(0, 36), between(-4, -3), between(-12, 0)], | ||
160 | #[between(0, 36), between(-4, 0), upTo(0)], | ||
161 | #[between(0, 36), between(-3, 4), UNBOUNDED], | ||
162 | #[between(0, 36), between(0, 4), above(0)], | ||
163 | #[between(0, 36), between(3, 4), between(0, 12)], | ||
164 | #[between(0, 36), ZERO, EMPTY], | ||
165 | #[between(12, 36), UNBOUNDED, UNBOUNDED], | ||
166 | #[between(12, 36), upTo(-2), between(-18, 0)], | ||
167 | #[between(12, 36), upTo(0), upTo(0)], | ||
168 | #[between(12, 36), upTo(3), UNBOUNDED], | ||
169 | #[between(12, 36), above(-2), UNBOUNDED], | ||
170 | #[between(12, 36), above(0), above(0)], | ||
171 | #[between(12, 36), above(3), between(0, 12)], | ||
172 | #[between(12, 36), between(-4, -3), between(-12, -3)], | ||
173 | #[between(12, 36), between(-4, 0), upTo(-3)], | ||
174 | #[between(12, 36), between(-3, 4), UNBOUNDED], | ||
175 | #[between(12, 36), between(0, 4), above(3)], | ||
176 | #[between(12, 36), between(3, 4), between(3, 12)], | ||
177 | #[between(12, 36), ZERO, EMPTY], | ||
178 | #[ZERO, UNBOUNDED, ZERO], | ||
179 | #[ZERO, upTo(-2), ZERO], | ||
180 | #[ZERO, upTo(0), ZERO], | ||
181 | #[ZERO, upTo(3), ZERO], | ||
182 | #[ZERO, above(-2), ZERO], | ||
183 | #[ZERO, above(0), ZERO], | ||
184 | #[ZERO, above(3), ZERO], | ||
185 | #[ZERO, between(-4, -3), ZERO], | ||
186 | #[ZERO, between(-4, 0), ZERO], | ||
187 | #[ZERO, between(-3, 4), ZERO], | ||
188 | #[ZERO, between(0, 4), ZERO], | ||
189 | #[ZERO, between(3, 4), ZERO], | ||
190 | #[ZERO, ZERO, EMPTY] | ||
191 | ] | ||
192 | } | ||
193 | |||
194 | @Parameter(0) public var Interval a | ||
195 | @Parameter(1) public var Interval b | ||
196 | @Parameter(2) public var Interval result | ||
197 | |||
198 | @Test | ||
199 | def void divisionTest() { | ||
200 | Assert.assertEquals(result, a / b) | ||
201 | } | ||
202 | } | ||