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/PowerTest.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/PowerTest.xtend')
-rw-r--r-- | Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/PowerTest.xtend | 43 |
1 files changed, 43 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/PowerTest.xtend b/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/PowerTest.xtend new file mode 100644 index 00000000..c842d90d --- /dev/null +++ b/Tests/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.tests/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/tests/interval/PowerTest.xtend | |||
@@ -0,0 +1,43 @@ | |||
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 PowerTest { | ||
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 | #[upTo(-1), between(-1, 2), EMPTY], | ||
23 | #[upTo(0), between(-1, 2), between(0, 0)], | ||
24 | #[upTo(2), between(-1, 2), above(0)], | ||
25 | #[upTo(2), between(1, 2), between(0, 4)], | ||
26 | #[above(1), between(1, 2), above(1)], | ||
27 | #[between(2, 4), upTo(1), between(0, 4)], | ||
28 | #[between(0.25, 0.5), upTo(1), above(0.25)], | ||
29 | #[between(2, 3), above(1), above(2)], | ||
30 | #[between(0.25, 0.5), above(1), between(0, 0.5)], | ||
31 | #[between(1, 2), between(-1, 2), between(0.5, 4)] | ||
32 | ] | ||
33 | } | ||
34 | |||
35 | @Parameter(0) public var Interval a | ||
36 | @Parameter(1) public var Interval b | ||
37 | @Parameter(2) public var Interval result | ||
38 | |||
39 | @Test | ||
40 | def void powerTest() { | ||
41 | Assert.assertEquals(result, a ** b) | ||
42 | } | ||
43 | } | ||