Change clues interface (WIP)

This commit is contained in:
Christian Basler
2024-07-18 18:05:01 +02:00
parent 5a96849108
commit 6356e0f4ac
8 changed files with 107 additions and 195 deletions

View File

@@ -20,19 +20,16 @@ class Game(
} }
} }
/**
* Make sure that no category is used more than once.
*/
fun areCategoriesValid(): Boolean { fun areCategoriesValid(): Boolean {
val usedCategories = mutableSetOf<ItemClassCompanion<*>>() return grid.rows.map { it.category }.distinct().size == grid.rows.size
for (row in grid.rows) {
if (usedCategories.contains(row.category)) {
return false
}
usedCategories.add(row.category)
}
return true
} }
fun areRulesViolated(): Boolean = clues fun isValid(): Boolean = areCategoriesValid() && clues.all { it.isValid(grid) }
.any { it.isRuleViolated(grid) }
fun isSolved(): Boolean = grid.cells.all { it.selection != null }
override fun toString(): String { override fun toString(): String {
return grid.toString() + "\n\n" + clues.joinToString("\n* ", prefix = "* ") return grid.toString() + "\n\n" + clues.joinToString("\n* ", prefix = "* ")

View File

@@ -5,11 +5,12 @@ class GameCell<C : ItemClass<C>>(
val solution: Item<C>, val solution: Item<C>,
val options: MutableList<Item<C>> val options: MutableList<Item<C>>
) )
//{
// val options = options.toMutableStateList()
// var selection by mutableStateOf(selection)
//}
fun <C : ItemClass<C>> GameCell<C>?.mayBe(item: Item<C>, mayHaveSelection: Boolean = true) = fun <C : ItemClass<C>> GameCell<C>?.mayBe(item: Item<C>, mayHaveSelection: Boolean = true) =
this != null && this != null &&
((mayHaveSelection && selection == item) || (selection == null && options.contains(item))) ((mayHaveSelection && selection == item) || (selection == null && options.contains(item)))
fun <C : ItemClass<C>> GameCell<C>?.isA(item: Item<C>) =
this != null && selection == item
fun <C : ItemClass<C>> GameCell<C>?.hasNoSelection() = this != null && this.selection == null

View File

@@ -1,7 +1,7 @@
package ch.dissem.yaep.domain package ch.dissem.yaep.domain
sealed class Clue { sealed class Clue {
abstract fun isRuleViolated(grid: Grid): Boolean abstract fun isValid(grid: Grid): Boolean
/** /**
* @return `true` if any option was removed * @return `true` if any option was removed
@@ -16,33 +16,19 @@ class NeighbourClue<A : ItemClass<A>, B : ItemClass<B>>(val a: Item<A>, val b: I
private val aType = a.itemType private val aType = a.itemType
private val bType = b.itemType private val bType = b.itemType
override fun isRuleViolated(grid: Grid): Boolean { override fun isValid(grid: Grid): Boolean {
val rowA = grid[aType.companion] val rowA = grid[aType.companion]
val rowB = grid[bType.companion] val rowB = grid[bType.companion]
val ia = rowA.indexOf(aType) val ia = rowA.indexOf(aType)
val ib by lazy { rowB.indexOf(bType) } val ib = rowB.indexOf(bType)
if (ia != -1) { if (ia != -1) {
if (ib != -1) return !(ib == ia - 1 || ib == ia + 1) if (ib != -1) return ib == ia - 1 || ib == ia + 1
return !(rowB.getOrNull(ia - 1).mayBe(b) || return rowB.getOrNull(ia - 1).hasNoSelection() || rowB.getOrNull(ia + 1).hasNoSelection()
rowB.getOrNull(ia + 1).mayBe(b))
} }
if (ib != -1) { if (ib != -1) {
return !(rowA.getOrNull(ib - 1).mayBe(a) || return rowA.getOrNull(ib - 1).hasNoSelection() || rowA.getOrNull(ib + 1).hasNoSelection()
rowA.getOrNull(ib + 1).mayBe(a))
}
for (i in 1 until grid.size) {
if (rowA[i - 1].mayBe(a) &&
rowB[i - 0].mayBe(b)
)
return false
if (rowA[i - 0].mayBe(a) &&
rowB[i - 1].mayBe(b)
)
return false
} }
return true return true
} }
@@ -86,23 +72,22 @@ class OrderClue<L : ItemClass<L>, R : ItemClass<R>>(val left: Item<L>, val right
private val leftType = left.itemType private val leftType = left.itemType
private val rightType = right.itemType private val rightType = right.itemType
override fun isRuleViolated(grid: Grid): Boolean { override fun isValid(grid: Grid): Boolean {
val rowLeft = grid[leftType.companion] val rowLeft = grid[leftType.companion]
val rowRight = grid[rightType.companion] val rowRight = grid[rightType.companion]
val iLeft = rowLeft.indexOf(leftType) val iLeft = rowLeft.indexOf(leftType)
val iRight by lazy { rowRight.indexOf(rightType) } val iRight by lazy { rowRight.indexOf(rightType) }
if (iLeft != -1) { if (iLeft != -1) {
if (iRight != -1) return iRight <= iLeft if (iRight != -1) return iRight > iLeft
return rowRight.indexOfLast { it.mayBe(right) } in 0..iLeft return rowRight.indexOfLast { it.hasNoSelection() } > iLeft
} }
if (iRight != -1) { if (iRight != -1) {
return rowLeft.indexOfFirst { it.mayBe(left) } >= iRight return rowLeft.indexOfFirst { it.hasNoSelection() } in 0 until iRight
} }
return rowLeft.indexOfFirst { it.hasNoSelection() } < rowRight.indexOfLast { it.hasNoSelection() }
return rowLeft.indexOfFirst { it.mayBe(left) } >= rowRight.indexOfLast { it.mayBe(right) }
} }
override fun removeForbiddenOptions(grid: Grid): Boolean { override fun removeForbiddenOptions(grid: Grid): Boolean {
@@ -136,7 +121,7 @@ class TripletClue<A : ItemClass<A>, B : ItemClass<B>, C : ItemClass<C>>(
private val bType = b.itemType private val bType = b.itemType
private val cType = c.itemType private val cType = c.itemType
override fun isRuleViolated(grid: Grid): Boolean { override fun isValid(grid: Grid): Boolean {
val rowA = grid[aType.companion] val rowA = grid[aType.companion]
val rowB by lazy { grid[bType.companion] } val rowB by lazy { grid[bType.companion] }
val rowC by lazy { grid[cType.companion] } val rowC by lazy { grid[cType.companion] }
@@ -146,73 +131,45 @@ class TripletClue<A : ItemClass<A>, B : ItemClass<B>, C : ItemClass<C>>(
val ic by lazy { rowC.indexOf(cType) } val ic by lazy { rowC.indexOf(cType) }
if (ia != -1) { if (ia != -1) {
if (ib != -1) { return when (ib) {
when (ib) { -1 -> when (ic) {
ia - 1 -> { -1 -> (rowB[ia - 1].hasNoSelection() && rowC[ia - 2].hasNoSelection()) || (rowB[ia + 1].hasNoSelection() && rowC[ia + 2].hasNoSelection())
return if (ic != -1) { ia - 2 -> rowB[ia - 1].hasNoSelection()
ic != ia - 2 ia + 2 -> rowB[ia + 1].hasNoSelection()
} else if (ia - 2 >= 0) { else -> false
!rowC[ia - 2].mayBe(c)
} else {
true
}
} }
ia + 1 -> { ia - 1 -> when (ic) {
return if (ic != -1) { -1 -> rowC[ia - 2].hasNoSelection()
ic != ia + 2 ia - 2 -> true
} else if (ia + 2 < grid.size) { else -> false
!rowC[ia + 2].mayBe(c)
} else {
true
}
} }
else -> return true ia + 1 -> when (ic) {
} -1 -> rowC[ia + 2].hasNoSelection()
} ia + 2 -> true
return when (ic) { else -> false
-1 -> !(rowB.getOrNull(ia - 1).mayBe(b) && rowC.getOrNull(ia - 2).mayBe(c)) &&
!(rowB.getOrNull(ia + 1).mayBe(b) && rowC.getOrNull(ia + 2).mayBe(c))
ia - 2 -> !rowB[ia - 1].mayBe(b)
ia + 2 -> !rowB[ia + 1].mayBe(b)
else -> true
}
} }
if (ib != -1) {
if (ib == 0 || ib == rowB.size - 1) return true
return when (ic) {
-1 -> !(rowA.getOrNull(ib - 1).mayBe(a) && rowC.getOrNull(ib + 1).mayBe(c)) &&
!(rowA.getOrNull(ib + 1).mayBe(a) && rowC.getOrNull(ib - 1).mayBe(c))
ib - 1 -> !rowA[ib + 1].mayBe(a)
ib + 1 -> !rowA[ib - 1].mayBe(a)
else -> false else -> false
} }
} }
if (ib != -1) {
when (ic) {
-1 -> return (rowA[ib - 1].hasNoSelection() && rowC[ib + 1].hasNoSelection()) || (rowA[ib + 1].hasNoSelection() && rowC[ib - 1].hasNoSelection())
ib - 1 -> return rowA[ib + 1].hasNoSelection()
ib + 1 -> return rowA[ib - 1].hasNoSelection()
}
}
if (ic != -1) { if (ic != -1) {
return !(rowB.getOrNull(ic - 1).mayBe(b) && rowA.getOrNull(ic - 2).mayBe(a)) && return (rowB[ic - 1].hasNoSelection() && rowA[ic - 2].hasNoSelection()) || (rowB[ic + 1].hasNoSelection() && rowA[ic + 2].hasNoSelection())
!(rowB.getOrNull(ic + 1).mayBe(b) && rowA.getOrNull(ic + 2).mayBe(a))
} }
return rowA.mapIndexed { index, gameCell -> if (gameCell.hasNoSelection()) index else null }
for (i in 2 until grid.size) { .filterNotNull()
if (rowA[i - 2].mayBe(a) && .any { index ->
rowB[i - 1].mayBe(b) && (rowB.getOrNull(index - 1).hasNoSelection() && rowC.getOrNull(index - 2).hasNoSelection()) ||
rowC[i - 0].mayBe(c) (rowB.getOrNull(index + 1).hasNoSelection() && rowC.getOrNull(index + 2).hasNoSelection())
)
return false
if (rowA[i - 0].mayBe(a) &&
rowB[i - 1].mayBe(b) &&
rowC[i - 2].mayBe(c)
)
return false
} }
return true
} }
override fun removeForbiddenOptions(grid: Grid): Boolean { override fun removeForbiddenOptions(grid: Grid): Boolean {
@@ -274,7 +231,7 @@ class SameColumnClue<A : ItemClass<A>, B : ItemClass<B>>(val a: Item<A>, val b:
private val aType = a.itemType private val aType = a.itemType
private val bType = b.itemType private val bType = b.itemType
override fun isRuleViolated(grid: Grid): Boolean { override fun isValid(grid: Grid): Boolean {
val rowA = grid[aType.companion] val rowA = grid[aType.companion]
val rowB = grid[bType.companion] val rowB = grid[bType.companion]
@@ -282,23 +239,15 @@ class SameColumnClue<A : ItemClass<A>, B : ItemClass<B>>(val a: Item<A>, val b:
val ib by lazy { rowB.indexOf(bType) } val ib by lazy { rowB.indexOf(bType) }
if (ia != -1) { if (ia != -1) {
return if (ib != -1) { return if (ib == -1) rowB[ia].hasNoSelection()
ib != ia else ib == ia
} else {
!rowB[ia].mayBe(b)
} }
}
if (ib != -1) { if (ib != -1) {
return !rowA[ib].mayBe(a) return rowA[ib].hasNoSelection()
} }
return rowA.mapIndexed { index, gameCell -> if (gameCell.hasNoSelection()) index else null }
for (i in 0 until grid.size) { .filterNotNull()
if (rowA[i].mayBe(a) && rowB[i].mayBe(b)) { .any { index -> rowB[index].hasNoSelection() }
return false
}
}
return true
} }
override fun removeForbiddenOptions(grid: Grid): Boolean { override fun removeForbiddenOptions(grid: Grid): Boolean {
@@ -326,11 +275,11 @@ class SameColumnClue<A : ItemClass<A>, B : ItemClass<B>>(val a: Item<A>, val b:
class PositionClue<C : ItemClass<C>>(val item: Item<C>, val index: Int) : Clue() { class PositionClue<C : ItemClass<C>>(val item: Item<C>, val index: Int) : Clue() {
val itemType = item.itemType val itemType = item.itemType
override fun isRuleViolated(grid: Grid): Boolean { override fun isValid(grid: Grid): Boolean {
val i = grid.indexOf(item.itemType) val i = grid.indexOf(item.itemType)
if (i != -1) return i != index if (i != -1) return i == index
return grid[item].mayBe(item) return grid[item].hasNoSelection()
} }
override fun removeForbiddenOptions(grid: Grid): Boolean { override fun removeForbiddenOptions(grid: Grid): Boolean {

View File

@@ -64,7 +64,7 @@ class GameTest {
} }
expect(game) { expect(game) {
feature(Game::areCategoriesValid).toEqual(true) feature(Game::areCategoriesValid).toEqual(true)
feature(Game::areRulesViolated).toEqual(false) feature(Game::isValid).toEqual(true)
feature(Game::clues) { feature(Game::clues) {
feature(List<Clue>::size).toBeGreaterThan(5) feature(List<Clue>::size).toBeGreaterThan(5)
feature(List<Clue>::size).toBeLessThan(30) feature(List<Clue>::size).toBeLessThan(30)

View File

@@ -15,10 +15,8 @@ class NeighbourClueTest : ClueTest() {
val a = grid[ia][j - 1] val a = grid[ia][j - 1]
val b = grid[ib][j] val b = grid[ib][j]
expect(NeighbourClue(a.solution, b.solution).isRuleViolated(grid)) expect(NeighbourClue(a.solution, b.solution).isValid(grid)).toEqual(true)
.toEqual(false) expect(NeighbourClue(b.solution, a.solution).isValid(grid)).toEqual(true)
expect(NeighbourClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(false)
} }
} }
} }
@@ -37,10 +35,8 @@ class NeighbourClueTest : ClueTest() {
val a = grid[ia][ja] val a = grid[ia][ja]
val b = grid[ib][jb] val b = grid[ib][jb]
expect(NeighbourClue(a.solution, b.solution).isRuleViolated(grid)) expect(NeighbourClue(a.solution, b.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(NeighbourClue(b.solution, a.solution).isValid(grid)).toEqual(false)
expect(NeighbourClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
} }
} }
} }
@@ -66,20 +62,16 @@ class NeighbourClueTest : ClueTest() {
b.selection = b.solution b.selection = b.solution
b.options.clear() b.options.clear()
expect(NeighbourClue(a.solution, b.solution).isRuleViolated(grid)) expect(NeighbourClue(a.solution, b.solution).isValid(grid)).toEqual(true)
.toEqual(false) expect(NeighbourClue(b.solution, a.solution).isValid(grid)).toEqual(true)
expect(NeighbourClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(false)
a.selection = a.solution a.selection = a.solution
a.options.clear() a.options.clear()
b.selection = null b.selection = null
b.options.add(b.solution) b.options.add(b.solution)
expect(NeighbourClue(a.solution, b.solution).isRuleViolated(grid)) expect(NeighbourClue(a.solution, b.solution).isValid(grid)).toEqual(true)
.toEqual(false) expect(NeighbourClue(b.solution, a.solution).isValid(grid)).toEqual(true)
expect(NeighbourClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(false)
if (j < size - 1) { if (j < size - 1) {
val notA = rowA[j + 1] val notA = rowA[j + 1]
@@ -90,10 +82,8 @@ class NeighbourClueTest : ClueTest() {
b.selection = b.solution b.selection = b.solution
b.options.clear() b.options.clear()
expect(NeighbourClue(a.solution, b.solution).isRuleViolated(grid)) expect(NeighbourClue(a.solution, b.solution).isValid(grid)).toEqual(true)
.toEqual(false) expect(NeighbourClue(b.solution, a.solution).isValid(grid)).toEqual(true)
expect(NeighbourClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(false)
} }
} }
} }
@@ -112,10 +102,8 @@ class NeighbourClueTest : ClueTest() {
rowB[3].selection = b.solution rowB[3].selection = b.solution
expect(NeighbourClue(a.solution, b.solution).isRuleViolated(grid)) expect(NeighbourClue(a.solution, b.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(NeighbourClue(b.solution, a.solution).isValid(grid)).toEqual(false)
expect(NeighbourClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
} }
} }

View File

@@ -16,8 +16,7 @@ class OrderClueTest : ClueTest() {
val a = grid[ia][ja] val a = grid[ia][ja]
val b = grid[ib][jb] val b = grid[ib][jb]
expect(OrderClue(a.solution, b.solution).isRuleViolated(grid)) expect(OrderClue(a.solution, b.solution).isValid(grid)).toEqual(true)
.toEqual(false)
} }
} }
} }
@@ -36,8 +35,7 @@ class OrderClueTest : ClueTest() {
val a = grid[ia][ja] val a = grid[ia][ja]
val b = grid[ib][jb] val b = grid[ib][jb]
expect(OrderClue(b.solution, a.solution).isRuleViolated(grid)) expect(OrderClue(b.solution, a.solution).isValid(grid)).toEqual(false)
.toEqual(true)
} }
} }
} }
@@ -51,8 +49,7 @@ class OrderClueTest : ClueTest() {
for (rowA in grid.rows) { for (rowA in grid.rows) {
for (rowB in grid.rows) { for (rowB in grid.rows) {
for (i in 0 until size) { for (i in 0 until size) {
expect(OrderClue(rowA[i].solution, rowB[i].solution).isRuleViolated(grid)) expect(OrderClue(rowA[i].solution, rowB[i].solution).isValid(grid)).toEqual(false)
.toEqual(true)
} }
} }
} }

View File

@@ -14,10 +14,8 @@ class SameColumnClueTest : ClueTest() {
val a = grid[ia][j] val a = grid[ia][j]
val b = grid[ib][j] val b = grid[ib][j]
expect(SameColumnClue(a.solution, b.solution).isRuleViolated(grid)) expect(SameColumnClue(a.solution, b.solution).isValid(grid)).toEqual(true)
.toEqual(false) expect(SameColumnClue(b.solution, a.solution).isValid(grid)).toEqual(true)
expect(SameColumnClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(false)
} }
} }
} }
@@ -34,10 +32,8 @@ class SameColumnClueTest : ClueTest() {
val a = grid[ia][ja] val a = grid[ia][ja]
val b = grid[ib][jb] val b = grid[ib][jb]
expect(SameColumnClue(a.solution, b.solution).isRuleViolated(grid)) expect(SameColumnClue(a.solution, b.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(SameColumnClue(b.solution, a.solution).isValid(grid)).toEqual(false)
expect(SameColumnClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
} }
} }
} }
@@ -59,10 +55,8 @@ class SameColumnClueTest : ClueTest() {
b.selection = null b.selection = null
b.options.remove(b.solution) b.options.remove(b.solution)
expect(SameColumnClue(a.solution, b.solution).isRuleViolated(grid)) expect(SameColumnClue(a.solution, b.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(SameColumnClue(b.solution, a.solution).isValid(grid)).toEqual(false)
expect(SameColumnClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
} }
} }
} }
@@ -94,10 +88,8 @@ class SameColumnClueTest : ClueTest() {
} }
} }
expect(SameColumnClue(a.solution, b.solution).isRuleViolated(grid)) expect(SameColumnClue(a.solution, b.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(SameColumnClue(b.solution, a.solution).isValid(grid)).toEqual(false)
expect(SameColumnClue(b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
} }
} }
} }

View File

@@ -17,10 +17,8 @@ class TripletClueTest : ClueTest() {
val b = grid[ib][j - 1] val b = grid[ib][j - 1]
val c = grid[ic][j] val c = grid[ic][j]
expect(TripletClue(a.solution, b.solution, c.solution).isRuleViolated(grid)) expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(true)
.toEqual(false) expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(true)
expect(TripletClue(c.solution, b.solution, a.solution).isRuleViolated(grid))
.toEqual(false)
} }
} }
} }
@@ -40,18 +38,14 @@ class TripletClueTest : ClueTest() {
rowB[0].selection = b.solution rowB[0].selection = b.solution
expect(TripletClue(a.solution, b.solution, c.solution).isRuleViolated(grid)) expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(false)
expect(TripletClue(c.solution, b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
rowB[0].selection = null rowB[0].selection = null
rowB[grid.size - 1].selection = b.solution rowB[grid.size - 1].selection = b.solution
expect(TripletClue(a.solution, b.solution, c.solution).isRuleViolated(grid)) expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(false)
expect(TripletClue(c.solution, b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
} }
@Test @Test
@@ -82,11 +76,11 @@ class TripletClueTest : ClueTest() {
index == ic -> { index == ic -> {
rowC[ia].options.add(c.solution) rowC[ia].options.add(c.solution)
expect(clue.isRuleViolated(grid)).toEqual(false) expect(clue.isValid(grid)).toEqual(true)
} }
else -> { else -> {
expect(clue.isRuleViolated(grid)).toEqual(true) expect(clue.isValid(grid)).toEqual(false)
} }
} }
notA.selection = null notA.selection = null
@@ -103,10 +97,8 @@ class TripletClueTest : ClueTest() {
a.selection = a.solution a.selection = a.solution
grid[1][4].selection = c.solution grid[1][4].selection = c.solution
expect(TripletClue(a.solution, b.solution, c.solution).isRuleViolated(grid)) expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(false)
expect(TripletClue(c.solution, b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
} }
@Test @Test
@@ -126,10 +118,8 @@ class TripletClueTest : ClueTest() {
rowB[4].options.add(b.solution) rowB[4].options.add(b.solution)
rowC[5].options.add(c.solution) rowC[5].options.add(c.solution)
expect(TripletClue(a.solution, b.solution, c.solution).isRuleViolated(grid)) expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(true)
.toEqual(false) expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(true)
expect(TripletClue(c.solution, b.solution, a.solution).isRuleViolated(grid))
.toEqual(false)
} }
@Test @Test
@@ -146,9 +136,7 @@ class TripletClueTest : ClueTest() {
grid[0][4].options.add(b.solution) grid[0][4].options.add(b.solution)
grid[1][5].options.remove(c.solution) grid[1][5].options.remove(c.solution)
expect(TripletClue(a.solution, b.solution, c.solution).isRuleViolated(grid)) expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(false)
.toEqual(true) expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(false)
expect(TripletClue(c.solution, b.solution, a.solution).isRuleViolated(grid))
.toEqual(true)
} }
} }