minor: remove usages of rule.tag() in tests
This commit is contained in:
parent
0cbc32d4a0
commit
799b57c74e
|
|
@ -54,7 +54,7 @@ interface MatchJournal : MutableIterable<MatchJournal.Chunk> {
|
|||
|
||||
var occurrences: MutableList<Entry> = 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
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue