From 799b57c74e396cae0228cc71f68ac670fe162a02 Mon Sep 17 00:00:00 2001 From: Grigorii Kirgizov Date: Mon, 20 May 2019 19:51:28 +0300 Subject: [PATCH] minor: remove usages of rule.tag() in tests --- .../core/internal/StoreAwareJournal.kt | 2 +- reactor/Test/test/TestStoreAwareJournal.kt | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/internal/StoreAwareJournal.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/internal/StoreAwareJournal.kt index 5aa7c30c..3f9d55a8 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/internal/StoreAwareJournal.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/internal/StoreAwareJournal.kt @@ -54,7 +54,7 @@ interface MatchJournal : MutableIterable { var occurrences: MutableList = mutableListOf() - override fun toString() = "(id=$id, $justifications, ${match.rule().tag()}, $occurrences)" + override fun toString() = "(id=$id, $justifications, ${match.rule().uniqueTag()}, $occurrences)" override fun chunk(): Chunk = this override fun entriesInChunk(): Int = occurrences.size diff --git a/reactor/Test/test/TestStoreAwareJournal.kt b/reactor/Test/test/TestStoreAwareJournal.kt index 5d292efb..c1b69ea9 100644 --- a/reactor/Test/test/TestStoreAwareJournal.kt +++ b/reactor/Test/test/TestStoreAwareJournal.kt @@ -73,7 +73,7 @@ class TestStoreAwareJournal { with(first()) { hist.logMatch(this) - rule().tag() shouldBe "rule1" +// rule().tag() shouldBe "rule1" hist.justs() shouldBe justsOf(0) val fooOcc = justifiedOccurrence("foo", hist.justs()) @@ -87,7 +87,7 @@ class TestStoreAwareJournal { with(elementAt(0)) { hist.logMatch(this) - rule().tag() shouldBe "rule2" +// rule().tag() shouldBe "rule2" hist.justs() shouldBe justsOf(0,1) val barOcc = justifiedOccurrence("bar", hist.justs()) @@ -101,7 +101,7 @@ class TestStoreAwareJournal { with(elementAt(1)) { hist.logMatch(this) - rule().tag() shouldBe "rule3" +// rule().tag() shouldBe "rule3" hist.justs() shouldBe justsOf(0,2) val quxOcc = justifiedOccurrence("qux", hist.justs()) @@ -113,7 +113,7 @@ class TestStoreAwareJournal { with(first()) { hist.logMatch(this) - rule().tag() shouldBe "rule4" +// rule().tag() shouldBe "rule4" } hist.justs() shouldBe justsOf(0,1,2,3) } @@ -241,7 +241,7 @@ class TestStoreAwareJournal { d = d.expand(mainOcc) with(d.matches().first()) { - rule().tag() shouldBe "rule1" +// rule().tag() shouldBe "rule1" hist.logMatch(this) } val fooOcc = justifiedOccurrence("foo", hist.justs()) @@ -250,7 +250,7 @@ class TestStoreAwareJournal { with(d.matches().first()) { - rule().tag() shouldBe "rule2" +// rule().tag() shouldBe "rule2" hist.logMatch(this) } val barOcc = occurrence("bar") @@ -264,7 +264,7 @@ class TestStoreAwareJournal { val curChunk = hist.currentPos().chunk() with(d.matches().first()) { - rule().tag() shouldBe "rule3" +// rule().tag() shouldBe "rule3" hist.logMatch(this) } // matched on rule with heads without justifications, should remain in the same chunk @@ -285,7 +285,7 @@ class TestStoreAwareJournal { with(d.matches().first()) { - rule().tag() shouldBe "rule4" +// rule().tag() shouldBe "rule4" hist.view().chunks.size shouldBe 2 hist.logMatch(this) hist.view().chunks.size shouldBe 3 @@ -379,7 +379,7 @@ class TestStoreAwareJournal { d = d.expand(mainOcc) with(d.matches().first()) { - rule().tag() shouldBe "rule0" +// rule().tag() shouldBe "rule0" hist.logMatch(this) } val fooOcc = justifiedOccurrence("foo", hist.justs()) @@ -387,7 +387,7 @@ class TestStoreAwareJournal { with(d.matches().first()) { - rule().tag() shouldBe "rule1" +// rule().tag() shouldBe "rule1" hist.logMatch(this) } val bar1Occ = occurrence("bar1") @@ -399,14 +399,14 @@ class TestStoreAwareJournal { val rule1matches = d.matches() rule1matches.count() shouldBe 2 with(rule1matches.first()) { - rule().tag() shouldBe "rule2a" +// rule().tag() shouldBe "rule2a" hist.logMatch(this) } //no productions in rule2a // this rule match will remain in history untouched with(rule1matches.last()) { - rule().tag() shouldBe "rule3" +// rule().tag() shouldBe "rule3" hist.logMatch(this) } val quxOcc0 = justifiedOccurrence("qux", hist.justs()) @@ -414,7 +414,7 @@ class TestStoreAwareJournal { with(d.matches().first()) { - rule().tag() shouldBe "ruleMakeP" +// rule().tag() shouldBe "ruleMakeP" hist.logMatch(this) } // val pOcc1 = occurrence("p") @@ -458,7 +458,7 @@ class TestStoreAwareJournal { d.matches().count() shouldBe 1 // this rule match is added at the place of rule2a match with(d.matches().first()) { - rule().tag() shouldBe "rule2b" +// rule().tag() shouldBe "rule2b" hist.logMatch(this) } val quxOcc1 = justifiedOccurrence("qux", hist.justs()) @@ -468,7 +468,7 @@ class TestStoreAwareJournal { d.matches().count() shouldBe 1 with(d.matches().first()) { - rule().tag() shouldBe "ruleMakeP" +// rule().tag() shouldBe "ruleMakeP" hist.logMatch(this) } // val pOcc2 = occurrence("p")