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/SubtractionTest.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/SubtractionTest.xtend')
-rw-r--r-- | Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/SubtractionTest.xtend | 49 |
1 files changed, 49 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/SubtractionTest.xtend b/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/SubtractionTest.xtend new file mode 100644 index 00000000..30709a9e --- /dev/null +++ b/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/SubtractionTest.xtend | |||
@@ -0,0 +1,49 @@ | |||
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 SubtractionTest { | ||
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, above(-2), UNBOUNDED], | ||
25 | #[UNBOUNDED, between(-1, 1), UNBOUNDED], | ||
26 | #[upTo(2), UNBOUNDED, UNBOUNDED], | ||
27 | #[upTo(2), upTo(1), UNBOUNDED], | ||
28 | #[upTo(2), above(-1), upTo(3)], | ||
29 | #[upTo(2), between(-1, 2), upTo(3)], | ||
30 | #[above(-2), UNBOUNDED, UNBOUNDED], | ||
31 | #[above(-2), upTo(1), above(-3)], | ||
32 | #[above(-2), above(-1), UNBOUNDED], | ||
33 | #[above(-2), between(-1, 2), above(-4)], | ||
34 | #[between(-2, 3), UNBOUNDED, UNBOUNDED], | ||
35 | #[between(-2, 3), upTo(1), above(-3)], | ||
36 | #[between(-2, 3), above(-1), upTo(4)], | ||
37 | #[between(-2, 3), between(-1, 2.5), between(-4.5, 4)] | ||
38 | ] | ||
39 | } | ||
40 | |||
41 | @Parameter(0) public var Interval a | ||
42 | @Parameter(1) public var Interval b | ||
43 | @Parameter(2) public var Interval result | ||
44 | |||
45 | @Test | ||
46 | def void subtractionTest() { | ||
47 | Assert.assertEquals(result, a - b) | ||
48 | } | ||
49 | } | ||