diff options
author | Kristóf Marussy <kristof@marussy.com> | 2023-08-19 20:31:17 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2023-08-19 20:31:17 +0200 |
commit | dc5fd2a009e43eb2486f50dea6eb9b487ad02c37 (patch) | |
tree | 4f20c29f368b79edce302318b8f9241112ffdd4e /subprojects/store-reasoning/src/test/java | |
parent | feat: interruptible VIATRA engine (diff) | |
download | refinery-dc5fd2a009e43eb2486f50dea6eb9b487ad02c37.tar.gz refinery-dc5fd2a009e43eb2486f50dea6eb9b487ad02c37.tar.zst refinery-dc5fd2a009e43eb2486f50dea6eb9b487ad02c37.zip |
fix: abstract type chain elimination
Diffstat (limited to 'subprojects/store-reasoning/src/test/java')
-rw-r--r-- | subprojects/store-reasoning/src/test/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeHierarchyTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/subprojects/store-reasoning/src/test/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeHierarchyTest.java b/subprojects/store-reasoning/src/test/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeHierarchyTest.java index 1f922a79..9fbf2334 100644 --- a/subprojects/store-reasoning/src/test/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeHierarchyTest.java +++ b/subprojects/store-reasoning/src/test/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeHierarchyTest.java | |||
@@ -13,6 +13,7 @@ import tools.refinery.store.representation.TruthValue; | |||
13 | import java.util.Set; | 13 | import java.util.Set; |
14 | 14 | ||
15 | import static org.hamcrest.MatcherAssert.assertThat; | 15 | import static org.hamcrest.MatcherAssert.assertThat; |
16 | import static org.hamcrest.Matchers.hasEntry; | ||
16 | import static org.junit.jupiter.api.Assertions.assertAll; | 17 | import static org.junit.jupiter.api.Assertions.assertAll; |
17 | import static org.junit.jupiter.api.Assertions.assertThrows; | 18 | import static org.junit.jupiter.api.Assertions.assertThrows; |
18 | 19 | ||
@@ -201,4 +202,22 @@ class TypeHierarchyTest { | |||
201 | 202 | ||
202 | assertThrows(IllegalArgumentException.class, builder::build); | 203 | assertThrows(IllegalArgumentException.class, builder::build); |
203 | } | 204 | } |
205 | |||
206 | @Test | ||
207 | void chainedEliminationTest() { | ||
208 | var a1 = new PartialRelation("A1", 1); | ||
209 | var a2 = new PartialRelation("A2", 1); | ||
210 | var c1 = new PartialRelation("C1", 1); | ||
211 | |||
212 | var sut = TypeHierarchy.builder() | ||
213 | .type(a1, true) | ||
214 | .type(a2, true, a1) | ||
215 | .type(c1, a2) | ||
216 | .build(); | ||
217 | |||
218 | assertAll( | ||
219 | () -> assertThat(sut.getEliminatedTypes(), hasEntry(a1, c1)), | ||
220 | () -> assertThat(sut.getEliminatedTypes(), hasEntry(a2, c1)) | ||
221 | ); | ||
222 | } | ||
204 | } | 223 | } |