From 3deb15469fe01c70fab4758c606c69a9153ce939 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Fri, 19 Aug 2022 21:55:12 +0800 Subject: [PATCH 01/10] Enhanced default and truncating Prettifier to pretty print tuples. --- .../scala/org/scalactic/PrettifierSpec.scala | 23 ++- .../main/scala/org/scalactic/Prettifier.scala | 7 +- .../AllElementsOfContainMatcherSpec.scala | 2 +- .../scalatest/AllOfContainMatcherSpec.scala | 4 +- .../scalatest/InOrderContainMatcherSpec.scala | 4 +- .../InOrderOnlyContainMatcherSpec.scala | 4 +- .../scalatest/InspectorShorthandsSpec.scala | 38 ++--- .../scalatest/NoneOfContainMatcherSpec.scala | 4 +- .../scalatest/OneOfContainMatcherSpec.scala | 4 +- .../scalatest/OnlyContainMatcherSpec.scala | 4 +- .../scalatest/ShouldContainElementSpec.scala | 160 +++++++++--------- 11 files changed, 139 insertions(+), 115 deletions(-) diff --git a/jvm/scalactic-test/src/test/scala/org/scalactic/PrettifierSpec.scala b/jvm/scalactic-test/src/test/scala/org/scalactic/PrettifierSpec.scala index 953aca7fc1..c95b927851 100644 --- a/jvm/scalactic-test/src/test/scala/org/scalactic/PrettifierSpec.scala +++ b/jvm/scalactic-test/src/test/scala/org/scalactic/PrettifierSpec.scala @@ -401,7 +401,21 @@ class PrettifierSpec extends funspec.AnyFunSpec with matchers.should.Matchers { Prettifier.default(new Fred) shouldBe "It's Fred all the way down" } // SKIP-DOTTY-END - it("should truncate collection when used with Prettifier.truncateAt") { + + case class Person(name: String, age: Int) + + it("should pretty print case class") { + val p = Person("John Lee", 35) + Prettifier.default(p) should be ("Person(\"John Lee\", 35)") + } + + it("should pretty print Tuple") { + Prettifier.default(("John Lee", 35)) should be ("(\"John Lee\", 35)") + } + } + + describe("the truncating Prettifier") { + it("should truncate collection") { val col = List(1, 2, 3) val prettifier = Prettifier.truncateAt(SizeLimit(2)) prettifier(col) shouldBe "List(1, 2, ...)" @@ -409,11 +423,16 @@ class PrettifierSpec extends funspec.AnyFunSpec with matchers.should.Matchers { case class CaseClazz(data: List[Int]) - it("should truncate collection inside of a case class when used with Prettifier.truncateAt") { + it("should truncate collection inside of a case class") { val caseClass = CaseClazz(List(1, 2, 3)) val prettifier = Prettifier.truncateAt(SizeLimit(2)) prettifier(caseClass) shouldBe "CaseClazz(List(1, 2, ...))" } + + it("should pretty print Tuple") { + val prettifier = Prettifier.truncateAt(SizeLimit(2)) + prettifier(("John Lee", 35)) should be ("(\"John Lee\", 35)") + } } } diff --git a/jvm/scalactic/src/main/scala/org/scalactic/Prettifier.scala b/jvm/scalactic/src/main/scala/org/scalactic/Prettifier.scala index 010ed3c4a1..eb2d83ec4e 100644 --- a/jvm/scalactic/src/main/scala/org/scalactic/Prettifier.scala +++ b/jvm/scalactic/src/main/scala/org/scalactic/Prettifier.scala @@ -182,6 +182,8 @@ private[scalactic] class DefaultPrettifier extends Prettifier { // overridden so lets use our custom prettifying otherwise we just use .toString. if (caseClazz.toString.startsWith(s"${caseClazz.productPrefix}(")) s"${caseClazz.productPrefix}(" + caseClazz.productIterator.map(prettify(_, processed + caseClazz)).mkString(", ") + ")" + else if (caseClazz.productPrefix.startsWith("Tuple")) + "(" + caseClazz.productIterator.map(prettify(_, processed + caseClazz)).mkString(", ") + ")" else caseClazz.toString case anythingElse => anythingElse.toString @@ -288,7 +290,10 @@ private[scalactic] class TruncatingPrettifier(sizeLimit: SizeLimit) extends Defa // Unlike in DefaultPrettifier where we check if a custom `.toString` has been overridden, with // TruncatingPrettifier the priority is truncating the enclosed data at all costs hence why we always // truncate the inner fields. - s"${caseClazz.productPrefix}(" + caseClazz.productIterator.map(prettify(_, processed + caseClazz)).mkString(", ") + ")" + if (caseClazz.productPrefix.startsWith("Tuple")) + s"(" + caseClazz.productIterator.map(prettify(_, processed + caseClazz)).mkString(", ") + ")" + else + s"${caseClazz.productPrefix}(" + caseClazz.productIterator.map(prettify(_, processed + caseClazz)).mkString(", ") + ")" case anythingElse => anythingElse.toString } } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/AllElementsOfContainMatcherSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/AllElementsOfContainMatcherSpec.scala index f3d604544a..47bd1ca0ce 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/AllElementsOfContainMatcherSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/AllElementsOfContainMatcherSpec.scala @@ -28,7 +28,7 @@ class AllElementsOfContainMatcherSpec extends funspec.AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = Prettifier.default(left) val rightText = Prettifier.default(right) - e.message should be (Some(leftText + " did not contain all elements of " + right)) + e.message should be (Some(leftText + " did not contain all elements of " + rightText)) e.failedCodeFileName should be (Some("AllElementsOfContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/AllOfContainMatcherSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/AllOfContainMatcherSpec.scala index 8265618106..438efb1aeb 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/AllOfContainMatcherSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/AllOfContainMatcherSpec.scala @@ -30,7 +30,7 @@ class AllOfContainMatcherSpec extends funspec.AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(leftText + " did not contain all of (" + right.mkString(", ") + ")")) + e.message should be (Some(leftText + " did not contain all of (" + right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", ") + ")")) e.failedCodeFileName should be (Some("AllOfContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } @@ -194,7 +194,7 @@ class AllOfContainMatcherSpec extends funspec.AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(leftText + " contained all of (" + right.mkString(", ") + ")")) + e.message should be (Some(leftText + " contained all of (" + right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", ") + ")")) e.failedCodeFileName should be (Some("AllOfContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/InOrderContainMatcherSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/InOrderContainMatcherSpec.scala index 06d8da4401..db84eb588b 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/InOrderContainMatcherSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/InOrderContainMatcherSpec.scala @@ -32,7 +32,7 @@ class InOrderContainMatcherSpec extends AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(leftText + " did not contain all of (" + right.mkString(", ") + ") in order")) + e.message should be (Some(leftText + " did not contain all of (" + right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", ") + ") in order")) e.failedCodeFileName should be (Some("InOrderContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } @@ -263,7 +263,7 @@ class InOrderContainMatcherSpec extends AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(leftText + " contained all of (" + right.mkString(", ") + ") in order")) + e.message should be (Some(leftText + " contained all of (" + right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", ") + ") in order")) e.failedCodeFileName should be (Some("InOrderContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/InOrderOnlyContainMatcherSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/InOrderOnlyContainMatcherSpec.scala index 7814805ecc..5d2bddcb52 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/InOrderOnlyContainMatcherSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/InOrderOnlyContainMatcherSpec.scala @@ -33,7 +33,7 @@ class InOrderOnlyContainMatcherSpec extends AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(leftText + " did not contain only (" + right.mkString(", ") + ") in order")) + e.message should be (Some(leftText + " did not contain only (" + right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", ") + ") in order")) e.failedCodeFileName should be (Some("InOrderOnlyContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } @@ -162,7 +162,7 @@ class InOrderOnlyContainMatcherSpec extends AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(leftText + " contained only (" + right.mkString(", ") + ") in order")) + e.message should be (Some(leftText + " contained only (" + right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", ") + ") in order")) e.failedCodeFileName should be (Some("InOrderOnlyContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/InspectorShorthandsSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/InspectorShorthandsSpec.scala index b64d9cfc97..5ffe9199fb 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/InspectorShorthandsSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/InspectorShorthandsSpec.scala @@ -1929,13 +1929,13 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks e.failedCodeLineNumber should be (Some(thisLineNumber - 3)) val firstViolation = getFirstNot[GenMap[String, String]](col, (map: GenMap[String, String]) => map.size == 3 && map.exists(e => e._1 == "1" && e._2 == "one") && map.exists(e => e._1 == "2" && e._2 == "two") && map.exists(e => e._1 == "8" && e._2 == "eight") ) e.message should be (Some("'all' inspection failed, because: \n" + - " at index " + getIndex(col, firstViolation) + ", " + decorateToStringValue(prettifier, firstViolation) + " did not contain the same elements as " + right + " (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + + " at index " + getIndex(col, firstViolation) + ", " + decorateToStringValue(prettifier, firstViolation) + " did not contain the same elements as " + decorateToStringValue(prettifier, right) + " (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + "in " + decorateToStringValue(prettifier, col))) e.getCause match { case tfe: exceptions.TestFailedException => tfe.failedCodeFileName should be (Some("InspectorShorthandsSpec.scala")) tfe.failedCodeLineNumber should be (Some(thisLineNumber - 11)) - tfe.message should be (Some(decorateToStringValue(prettifier, firstViolation) + " did not contain the same elements as " + right.toString)) + tfe.message should be (Some(decorateToStringValue(prettifier, firstViolation) + " did not contain the same elements as " + decorateToStringValue(prettifier, right))) tfe.getCause should be (null) case other => fail("Expected cause to be TestFailedException, but got: " + other) } @@ -2343,7 +2343,7 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks } it("should throw TestFailedException with correct message and stack depth when all(map) should contain failed") { - val right = "(" + Array("1" -> "one", "2" -> "two", "8" -> "eight").mkString(", ") + ")" + val right = "(" + Array("1" -> "one", "2" -> "two", "8" -> "eight").map(t => decorateToStringValue(prettifier, t)).mkString(", ") + ")" forAll(mapExamples) { colFun => val col = colFun(Set(Map("1" -> "one", "2" -> "two", "8" -> "eight"), Map("2" -> "two", "3" -> "three", "1" -> "one"), Map("3" -> "three", "8" -> "eight", "1" -> "one"))) val e = intercept[exceptions.TestFailedException] { @@ -2463,7 +2463,7 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks } it("should throw TestFailedException with correct message and stack depth when all(map) should not contain failed") { - val right = Array("1" -> "one", "2" -> "two", "8" -> "eight") + val right = Array("1" -> "one", "2" -> "two", "8" -> "eight").map(e => decorateToStringValue(prettifier, e)).mkString(", ") forAll(mapExamples) { colFun => val col = colFun(Set(Map("1" -> "one", "2" -> "two", "8" -> "eight"), Map("2" -> "two", "3" -> "three", "1" -> "one"), Map("3" -> "three", "8" -> "eight", "1" -> "one"))) val e = intercept[exceptions.TestFailedException] { @@ -2473,13 +2473,13 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks e.failedCodeLineNumber should be (Some(thisLineNumber - 3)) val firstViolation = getFirst[GenMap[String, String]](col, map => map.size == 3 && map.toList(0)._1 == "1" && map.toList(0)._2 == "one" && map.toList(1)._1 == "2" && map.toList(1)._2 == "two" && map.toList(2)._1 == "8" && map.toList(2)._2 == "eight" ) e.message should be (Some("'all' inspection failed, because: \n" + - " at index " + getIndex(col, firstViolation) + ", " + decorateToStringValue(prettifier, firstViolation) + " contained all of (" + right.mkString(", ") + ") (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + + " at index " + getIndex(col, firstViolation) + ", " + decorateToStringValue(prettifier, firstViolation) + " contained all of (" + right + ") (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + "in " + decorateToStringValue(prettifier, col))) e.getCause match { case tfe: exceptions.TestFailedException => tfe.failedCodeFileName should be (Some("InspectorShorthandsSpec.scala")) tfe.failedCodeLineNumber should be (Some(thisLineNumber - 11)) - tfe.message should be (Some(decorateToStringValue(prettifier, firstViolation) + " contained all of (" + right.mkString(", ") + ")")) + tfe.message should be (Some(decorateToStringValue(prettifier, firstViolation) + " contained all of (" + right + ")")) tfe.getCause should be (null) case other => fail("Expected cause to be TestFailedException, but got: " + other) } @@ -2767,7 +2767,7 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks } it("should throw TestFailedException with correct message and stack depth when all(map) should contain failed") { - val right = "(" + Array("3" -> "three", "5" -> "five", "7" -> "seven").mkString(", ") + ")" + val right = "(" + Array("3" -> "three", "5" -> "five", "7" -> "seven").map(e => decorateToStringValue(prettifier, e)).mkString(", ") + ")" forAll(mapExamples) { colFun => val col = colFun(Set(Map("1" -> "one", "2" -> "two", "8" -> "eight"), Map("2" -> "two", "3" -> "three", "1" -> "one"), Map("3" -> "three", "8" -> "eight", "1" -> "one"))) val e = intercept[exceptions.TestFailedException] { @@ -2887,7 +2887,7 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks } it("should throw TestFailedException with correct message and stack depth when all(map) should not contain failed") { - val right = Array("6" -> "six", "7" -> "seven", "8" -> "eight") + val right = Array("6" -> "six", "7" -> "seven", "8" -> "eight").map(e => decorateToStringValue(prettifier, e)).mkString(", ") forAll(mapExamples) { colFun => val col = colFun(Set(Map("1" -> "one", "2" -> "two", "8" -> "eight"), Map("2" -> "two", "3" -> "three", "1" -> "one"), Map("3" -> "three", "8" -> "eight", "1" -> "one"))) val e = intercept[exceptions.TestFailedException] { @@ -2897,13 +2897,13 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks e.failedCodeLineNumber should be (Some(thisLineNumber - 3)) val firstViolation = getFirst[GenMap[String, String]](col, map => map.exists(t => t._1 == "6" && t._2 == "six") || map.exists(t => t._1 == "7" && t._2 == "seven") || map.exists(t => t._1 == "8" && t._2 == "eight") ) e.message should be (Some("'all' inspection failed, because: \n" + - " at index " + getIndex(col, firstViolation) + ", " + decorateToStringValue(prettifier, firstViolation) + " contained at least one of (" + right.mkString(", ") + ") (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + + " at index " + getIndex(col, firstViolation) + ", " + decorateToStringValue(prettifier, firstViolation) + " contained at least one of (" + right + ") (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + "in " + decorateToStringValue(prettifier, col))) e.getCause match { case tfe: exceptions.TestFailedException => tfe.failedCodeFileName should be (Some("InspectorShorthandsSpec.scala")) tfe.failedCodeLineNumber should be (Some(thisLineNumber - 11)) - tfe.message should be (Some(decorateToStringValue(prettifier, firstViolation) + " contained at least one of (" + right.mkString(", ") + ")")) + tfe.message should be (Some(decorateToStringValue(prettifier, firstViolation) + " contained at least one of (" + right + ")")) tfe.getCause should be (null) case other => fail("Expected cause to be TestFailedException, but got: " + other) } @@ -3010,7 +3010,7 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks } it("should throw TestFailedException with correct message and stack depth when all(map) should contain failed") { - val right = "(" + Array("1" -> "one", "2" -> "two", "8" -> "eight").mkString(", ") + ")" + val right = "(" + Array("1" -> "one", "2" -> "two", "8" -> "eight").map(e => decorateToStringValue(prettifier, e)).mkString(", ") + ")" forAll(mapExamples) { colFun => val col = colFun(Set(Map("1" -> "one", "2" -> "two", "8" -> "eight"), Map("2" -> "two", "3" -> "three", "1" -> "one"), Map("3" -> "three", "8" -> "eight", "1" -> "one"))) val e = intercept[exceptions.TestFailedException] { @@ -3130,7 +3130,7 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks } it("should throw TestFailedException with correct message and stack depth when all(map) should not contain failed") { - val right = Array("1" -> "one", "2" -> "two", "8" -> "eight") + val right = Array("1" -> "one", "2" -> "two", "8" -> "eight").map(e => decorateToStringValue(prettifier, e)).mkString(", ") forAll(mapExamples) { colFun => val col = colFun(Set(Map("1" -> "one", "2" -> "two", "8" -> "eight"), Map("2" -> "two", "3" -> "three", "1" -> "one"), Map("3" -> "three", "8" -> "eight", "1" -> "one"))) val e = intercept[exceptions.TestFailedException] { @@ -3140,13 +3140,13 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks e.failedCodeLineNumber should be (Some(thisLineNumber - 3)) val firstViolation = getFirst[GenMap[String, String]](col, map => map.size == 3 && map.exists(t => t._1 == "1" && t._2 == "one") && map.exists(t => t._1 == "2" && t._2 == "two") && map.exists(t => t._1 == "8" && t._2 == "eight") ) e.message should be (Some("'all' inspection failed, because: \n" + - " at index " + getIndex(col, firstViolation) + ", " + decorateToStringValue(prettifier, firstViolation) + " contained only (" + right.mkString(", ") + ") (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + + " at index " + getIndex(col, firstViolation) + ", " + decorateToStringValue(prettifier, firstViolation) + " contained only (" + right + ") (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + "in " + decorateToStringValue(prettifier, col))) e.getCause match { case tfe: exceptions.TestFailedException => tfe.failedCodeFileName should be (Some("InspectorShorthandsSpec.scala")) tfe.failedCodeLineNumber should be (Some(thisLineNumber - 11)) - tfe.message should be (Some(decorateToStringValue(prettifier, firstViolation) + " contained only (" + right.mkString(", ") + ")")) + tfe.message should be (Some(decorateToStringValue(prettifier, firstViolation) + " contained only (" + right + ")")) tfe.getCause should be (null) case other => fail("Expected cause to be TestFailedException, but got: " + other) } @@ -3443,13 +3443,13 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks e.failedCodeLineNumber should be (Some(thisLineNumber - 3)) val firstViolation = getFirst[GenMap[String, String]](col, map => map.exists(e => e._1 == "1" && e._2 == "one") || map.exists(e => e._1 == "2" && e._2 == "two") || map.exists(e => e._1 == "8" && e._2 == "eight") ) e.message should be (Some("'all' inspection failed, because: \n" + - " at index " + getIndex(col, firstViolation) + ", " + FailureMessages.containedAtLeastOneOf(prettifier, firstViolation, UnquotedString("(1,one), (2,two), (8,eight)")) + " (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + + " at index " + getIndex(col, firstViolation) + ", " + FailureMessages.containedAtLeastOneOf(prettifier, firstViolation, UnquotedString("(\"1\", \"one\"), (\"2\", \"two\"), (\"8\", \"eight\")")) + " (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + "in " + decorateToStringValue(prettifier, col))) e.getCause match { case tfe: exceptions.TestFailedException => tfe.failedCodeFileName should be (Some("InspectorShorthandsSpec.scala")) tfe.failedCodeLineNumber should be (Some(thisLineNumber - 11)) - tfe.message should be (Some(FailureMessages.containedAtLeastOneOf(prettifier, firstViolation, UnquotedString("(1,one), (2,two), (8,eight)")))) + tfe.message should be (Some(FailureMessages.containedAtLeastOneOf(prettifier, firstViolation, UnquotedString("(\"1\", \"one\"), (\"2\", \"two\"), (\"8\", \"eight\")")))) tfe.getCause should be (null) case other => fail("Expected cause to be TestFailedException, but got: " + other) } @@ -3552,7 +3552,7 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks } it("should throw TestFailedException with correct message and stack depth when all(map) should not contain failed") { - val right = Array("6" -> "six", "7" -> "seven", "9" -> "nine") + val right = Array("6" -> "six", "7" -> "seven", "9" -> "nine").map(e => decorateToStringValue(prettifier, e)).mkString(", ") forAll(mapExamples) { colFun => val col = colFun(Set(Map("1" -> "one", "2" -> "two", "8" -> "eight"), Map("2" -> "two", "3" -> "three", "1" -> "one"), Map("3" -> "three", "8" -> "eight", "1" -> "one"))) val e = intercept[exceptions.TestFailedException] { @@ -3562,13 +3562,13 @@ class InspectorShorthandsSpec extends AnyFunSpec with TableDrivenPropertyChecks e.failedCodeLineNumber should be (Some(thisLineNumber - 3)) val firstViolation = getFirst[GenMap[String, String]](col, map => map.exists(t => t._1 != "6" && t._2 != "six") && map.exists(t => t._1 != "7" && t._2 != "seven") && map.exists(t => t._1 != "9" && t._2 != "nine") ) e.message should be (Some("'all' inspection failed, because: \n" + - " at index " + getIndex(col, firstViolation) + ", " + FailureMessages.didNotContainAtLeastOneOf(prettifier, firstViolation, UnquotedString(right.mkString(", "))) + " (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + + " at index " + getIndex(col, firstViolation) + ", " + FailureMessages.didNotContainAtLeastOneOf(prettifier, firstViolation, UnquotedString(right)) + " (InspectorShorthandsSpec.scala:" + (thisLineNumber - 6) + ") \n" + "in " + decorateToStringValue(prettifier, col))) e.getCause match { case tfe: exceptions.TestFailedException => tfe.failedCodeFileName should be (Some("InspectorShorthandsSpec.scala")) tfe.failedCodeLineNumber should be (Some(thisLineNumber - 11)) - tfe.message should be (Some(FailureMessages.didNotContainAtLeastOneOf(prettifier, firstViolation, UnquotedString(right.mkString(", "))))) + tfe.message should be (Some(FailureMessages.didNotContainAtLeastOneOf(prettifier, firstViolation, UnquotedString(right)))) tfe.getCause should be (null) case other => fail("Expected cause to be TestFailedException, but got: " + other) } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/NoneOfContainMatcherSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/NoneOfContainMatcherSpec.scala index 9008e4c7fe..c977e92995 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/NoneOfContainMatcherSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/NoneOfContainMatcherSpec.scala @@ -29,7 +29,7 @@ class NoneOfContainMatcherSpec extends funspec.AnyFunSpec { describe("noneOf ") { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { - e.message should be (Some(FailureMessages.containedAtLeastOneOf(prettifier, left, UnquotedString(right.mkString(", "))))) + e.message should be (Some(FailureMessages.containedAtLeastOneOf(prettifier, left, UnquotedString(right.map(prettifier.apply).mkString(", "))))) e.failedCodeFileName should be (Some("NoneOfContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } @@ -116,7 +116,7 @@ class NoneOfContainMatcherSpec extends funspec.AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(FailureMessages.didNotContainAtLeastOneOf(prettifier, left, UnquotedString(right.mkString(", "))))) + e.message should be (Some(FailureMessages.didNotContainAtLeastOneOf(prettifier, left, UnquotedString(right.map(prettifier.apply).mkString(", "))))) e.failedCodeFileName should be (Some("NoneOfContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/OneOfContainMatcherSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/OneOfContainMatcherSpec.scala index 7b1e0ff8a2..b1b381dc67 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/OneOfContainMatcherSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/OneOfContainMatcherSpec.scala @@ -30,7 +30,7 @@ class OneOfContainMatcherSpec extends AnyFunSpec { describe("oneOf ") { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { - e.message should be (Some(FailureMessages.didNotContainOneOfElements(prettifier, left, UnquotedString(right.mkString(", "))))) + e.message should be (Some(FailureMessages.didNotContainOneOfElements(prettifier, left, UnquotedString(right.map(prettifier.apply).mkString(", "))))) e.failedCodeFileName should be (Some("OneOfContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } @@ -326,7 +326,7 @@ class OneOfContainMatcherSpec extends AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(FailureMessages.containedOneOfElements(prettifier, left, UnquotedString(right.mkString(", "))))) + e.message should be (Some(FailureMessages.containedOneOfElements(prettifier, left, UnquotedString(right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", "))))) e.failedCodeFileName should be (Some("OneOfContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/OnlyContainMatcherSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/OnlyContainMatcherSpec.scala index c5c497f235..30c4c1d39e 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/OnlyContainMatcherSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/OnlyContainMatcherSpec.scala @@ -32,7 +32,7 @@ class OnlyContainMatcherSpec extends AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(leftText + " did not contain only (" + right.mkString(", ") + ")")) + e.message should be (Some(leftText + " did not contain only (" + right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", ") + ")")) e.failedCodeFileName should be (Some("OnlyContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } @@ -152,7 +152,7 @@ class OnlyContainMatcherSpec extends AnyFunSpec { def checkStackDepth(e: exceptions.StackDepthException, left: Any, right: GenTraversable[Any], lineNumber: Int): Unit = { val leftText = FailureMessages.decorateToStringValue(prettifier, left) - e.message should be (Some(leftText + " contained only (" + right.mkString(", ") + ")")) + e.message should be (Some(leftText + " contained only (" + right.map(e => FailureMessages.decorateToStringValue(prettifier, e)).mkString(", ") + ")")) e.failedCodeFileName should be (Some("OnlyContainMatcherSpec.scala")) e.failedCodeLineNumber should be (Some(lineNumber)) } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/ShouldContainElementSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/ShouldContainElementSpec.scala index 55da508450..33a0c8d272 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/ShouldContainElementSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/ShouldContainElementSpec.scala @@ -1290,7 +1290,7 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should contain ("three" -> 3) } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (three,3)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"three\", 3)") } it("should throw TestFailedException if contains the specified element when used with not") { @@ -1298,17 +1298,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should (not contain ("two" -> 2)) } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught2 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should not (contain ("two" -> 2)) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught3 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should not contain ("two" -> 2) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-and expression") { @@ -1316,17 +1316,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should { contain ("five" -> 5) and (contain ("two" -> 2)) } } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (five,5)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"five\", 5)") val caught2 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should ((contain ("five" -> 5)) and (contain ("two" -> 2))) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (five,5)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"five\", 5)") val caught3 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should (contain ("five" -> 5) and contain ("two" -> 2)) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (five,5)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"five\", 5)") } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-or expression") { @@ -1334,17 +1334,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should { contain ("fifty five" -> 55) or (contain ("twenty two" -> 22)) } } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (fifty five,55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (twenty two,22)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"fifty five\", 55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"twenty two\", 22)") val caught2 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should ((contain ("fifty five" -> 55)) or (contain ("twenty two" -> 22))) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (fifty five,55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (twenty two,22)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"fifty five\", 55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"twenty two\", 22)") val caught3 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should (contain ("fifty five" -> 55) or contain ("twenty two" -> 22)) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (fifty five,55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (twenty two,22)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"fifty five\", 55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"twenty two\", 22)") } it("should throw an TestFailedException when map contains specified element and used in a logical-and expression with not") { @@ -1352,17 +1352,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should { not { contain ("three" -> 3) } and not { contain ("two" -> 2) }} } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (three,3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"three\", 3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught2 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should ((not contain ("three" -> 3)) and (not contain ("two" -> 2))) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (three,3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"three\", 3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught3 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should (not contain ("three" -> 3) and not contain ("two" -> 2)) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (three,3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"three\", 3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") } it("should throw an TestFailedException when map contains specified element and used in a logical-or expression with not") { @@ -1370,17 +1370,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should { not { contain ("two" -> 2) } or not { contain ("two" -> 2) }} } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught2 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should ((not contain ("two" -> 2)) or (not contain ("two" -> 2))) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught3 = intercept[TestFailedException] { Map("one" -> 1, "two" -> 2) should (not contain ("two" -> 2) or not contain ("two" -> 2)) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") } // SKIP-SCALATESTJS,NATIVE-START @@ -1435,7 +1435,7 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] {( map should contain ("three" -> 3) )} - assert(caught1.getMessage === decorateToStringValue(prettifier, map) + " did not contain element (three,3)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map) + " did not contain element (\"three\", 3)") } it("should throw TestFailedException if contains the specified element when used with not") { @@ -1443,19 +1443,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] {( map1 should (not contain ("two" -> 2)) )} - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " contained element (two,2)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " contained element (\"two\", 2)") val map2 = mutable.Map("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] {( map2 should not (contain ("two" -> 2)) )} - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " contained element (two,2)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " contained element (\"two\", 2)") val map3 = mutable.Map("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] { map3 should not contain ("two" -> 2) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " contained element (two,2)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " contained element (\"two\", 2)") } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-and expression") { @@ -1463,19 +1463,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map1 should { contain ("five" -> 5) and (contain ("two" -> 2)) } } - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (five,5)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (\"five\", 5)") val map2 = mutable.Map("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] { map2 should ((contain ("five" -> 5)) and (contain ("two" -> 2))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (five,5)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (\"five\", 5)") val map3 = mutable.Map("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] { map3 should (contain ("five" -> 5) and contain ("two" -> 2)) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (five,5)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (\"five\", 5)") } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-or expression") { @@ -1483,19 +1483,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map1 should { contain ("fifty five" -> 55) or (contain ("twenty two" -> 22)) } } - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (fifty five,55), and " + decorateToStringValue(prettifier, map1) + " did not contain element (twenty two,22)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (\"fifty five\", 55), and " + decorateToStringValue(prettifier, map1) + " did not contain element (\"twenty two\", 22)") val map2 = mutable.Map("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] { map2 should ((contain ("fifty five" -> 55)) or (contain ("twenty two" -> 22))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (fifty five,55), and " + decorateToStringValue(prettifier, map2) + " did not contain element (twenty two,22)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (\"fifty five\", 55), and " + decorateToStringValue(prettifier, map2) + " did not contain element (\"twenty two\", 22)") val map3 = mutable.Map("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] {( map3 should (contain ("fifty five" -> 55) or contain ("twenty two" -> 22))) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (fifty five,55), and " + decorateToStringValue(prettifier, map3) + " did not contain element (twenty two,22)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (\"fifty five\", 55), and " + decorateToStringValue(prettifier, map3) + " did not contain element (\"twenty two\", 22)") } it("should throw an TestFailedException when map contains specified element and used in a logical-and expression with not") { @@ -1503,19 +1503,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map1 should { not { contain ("three" -> 3) } and not { contain ("two" -> 2) }} } - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (three,3), but " + decorateToStringValue(prettifier, map1) + " contained element (two,2)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (\"three\", 3), but " + decorateToStringValue(prettifier, map1) + " contained element (\"two\", 2)") val map2 = mutable.Map("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] { map2 should ((not contain ("three" -> 3)) and (not contain ("two" -> 2))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (three,3), but " + decorateToStringValue(prettifier, map2) + " contained element (two,2)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (\"three\", 3), but " + decorateToStringValue(prettifier, map2) + " contained element (\"two\", 2)") val map3 = mutable.Map("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] { map3 should (not contain ("three" -> 3) and not contain ("two" -> 2)) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (three,3), but " + decorateToStringValue(prettifier, map3) + " contained element (two,2)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (\"three\", 3), but " + decorateToStringValue(prettifier, map3) + " contained element (\"two\", 2)") } it("should throw an TestFailedException when map contains specified element and used in a logical-or expression with not") { @@ -1523,19 +1523,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map1 should { not { contain ("two" -> 2) } or not { contain ("two" -> 2) }} } - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " contained element (two,2), and " + decorateToStringValue(prettifier, map1) + " contained element (two,2)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " contained element (\"two\", 2), and " + decorateToStringValue(prettifier, map1) + " contained element (\"two\", 2)") val map2 = mutable.Map("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] { map2 should ((not contain ("two" -> 2)) or (not contain ("two" -> 2))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " contained element (two,2), and " + decorateToStringValue(prettifier, map2) + " contained element (two,2)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " contained element (\"two\", 2), and " + decorateToStringValue(prettifier, map2) + " contained element (\"two\", 2)") val map3 = mutable.Map("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] { map3 should (not contain ("two" -> 2) or not contain ("two" -> 2)) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " contained element (two,2), and " + decorateToStringValue(prettifier, map3) + " contained element (two,2)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " contained element (\"two\", 2), and " + decorateToStringValue(prettifier, map3) + " contained element (\"two\", 2)") } // SKIP-SCALATESTJS,NATIVE-START @@ -1589,7 +1589,7 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map should contain ("three" -> 3) } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (three,3)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"three\", 3)") } it("should throw TestFailedException if contains the specified element when used with not") { @@ -1597,17 +1597,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map should (not contain ("two" -> 2)) } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught2 = intercept[TestFailedException] { map should not (contain ("two" -> 2)) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught3 = intercept[TestFailedException] { map should not contain ("two" -> 2) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-and expression") { @@ -1615,17 +1615,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map should { contain ("five" -> 5) and (contain ("two" -> 2)) } } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (five,5)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"five\", 5)") val caught2 = intercept[TestFailedException] { map should ((contain ("five" -> 5)) and (contain ("two" -> 2))) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (five,5)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"five\", 5)") val caught3 = intercept[TestFailedException] { map should (contain ("five" -> 5) and contain ("two" -> 2)) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (five,5)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"five\", 5)") } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-or expression") { @@ -1633,17 +1633,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map should { contain ("fifty five" -> 55) or (contain ("twenty two" -> 22)) } } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (fifty five,55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (twenty two,22)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"fifty five\", 55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"twenty two\", 22)") val caught2 = intercept[TestFailedException] { map should ((contain ("fifty five" -> 55)) or (contain ("twenty two" -> 22))) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (fifty five,55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (twenty two,22)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"fifty five\", 55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"twenty two\", 22)") val caught3 = intercept[TestFailedException] { map should (contain ("fifty five" -> 55) or contain ("twenty two" -> 22)) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (fifty five,55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (twenty two,22)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"fifty five\", 55), and Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"twenty two\", 22)") } it("should throw an TestFailedException when map contains specified element and used in a logical-and expression with not") { @@ -1651,17 +1651,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map should { not { contain ("three" -> 3) } and not { contain ("two" -> 2) }} } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (three,3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"three\", 3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught2 = intercept[TestFailedException] { map should ((not contain ("three" -> 3)) and (not contain ("two" -> 2))) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (three,3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"three\", 3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught3 = intercept[TestFailedException] { map should (not contain ("three" -> 3) and not contain ("two" -> 2)) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (three,3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) did not contain element (\"three\", 3), but Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") } it("should throw an TestFailedException when map contains specified element and used in a logical-or expression with not") { @@ -1669,17 +1669,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map should { not { contain ("two" -> 2) } or not { contain ("two" -> 2) }} } - assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught1.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught2 = intercept[TestFailedException] { map should ((not contain ("two" -> 2)) or (not contain ("two" -> 2))) } - assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught2.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") val caught3 = intercept[TestFailedException] { map should (not contain ("two" -> 2) or not contain ("two" -> 2)) } - assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (two,2)") + assert(caught3.getMessage === "Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2), and Map(\"one\" -> 1, \"two\" -> 2) contained element (\"two\", 2)") } // SKIP-SCALATESTJS,NATIVE-START @@ -1733,7 +1733,7 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should contain ("three" -> 3) } - assert(caught1.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (three,3)")) + assert(caught1.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"three\", 3)")) } it("should throw TestFailedException if contains the specified element when used with not") { @@ -1741,17 +1741,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should (not contain ("two" -> 2)) } - assert(caught1.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught1.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) val caught2 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should not (contain ("two" -> 2)) } - assert(caught2.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught2.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) val caught3 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should not contain ("two" -> 2) } - assert(caught3.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught3.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-and expression") { @@ -1759,17 +1759,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should { contain ("five" -> 5) and (contain ("two" -> 2)) } } - assert(caught1.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (five,5)")) + assert(caught1.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"five\", 5)")) val caught2 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should ((contain ("five" -> 5)) and (contain ("two" -> 2))) } - assert(caught2.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (five,5)")) + assert(caught2.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"five\", 5)")) val caught3 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should (contain ("five" -> 5) and contain ("two" -> 2)) } - assert(caught3.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (five,5)")) + assert(caught3.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"five\", 5)")) } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-or expression") { @@ -1777,17 +1777,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should { contain ("fifty five" -> 55) or (contain ("twenty two" -> 22)) } } - assert(caught1.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (fifty five,55), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (twenty two,22)")) + assert(caught1.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"fifty five\", 55), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"twenty two\", 22)")) val caught2 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should ((contain ("fifty five" -> 55)) or (contain ("twenty two" -> 22))) } - assert(caught2.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (fifty five,55), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (twenty two,22)")) + assert(caught2.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"fifty five\", 55), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"twenty two\", 22)")) val caught3 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should (contain ("fifty five" -> 55) or contain ("twenty two" -> 22)) } - assert(caught3.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (fifty five,55), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (twenty two,22)")) + assert(caught3.getMessage == (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"fifty five\", 55), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"twenty two\", 22)")) } it("should throw an TestFailedException when map contains specified element and used in a logical-and expression with not") { @@ -1795,17 +1795,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should { not { contain ("three" -> 3) } and not { contain ("two" -> 2) }} } - assert(caught1.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (three,3), but " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught1.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"three\", 3), but " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) val caught2 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should ((not contain ("three" -> 3)) and (not contain ("two" -> 2))) } - assert(caught2.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (three,3), but " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught2.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"three\", 3), but " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) val caught3 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should (not contain ("three" -> 3) and not contain ("two" -> 2)) } - assert(caught3.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (three,3), but " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught3.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " did not contain element (\"three\", 3), but " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) } it("should throw an TestFailedException when map contains specified element and used in a logical-or expression with not") { @@ -1813,17 +1813,17 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should { not { contain ("two" -> 2) } or not { contain ("two" -> 2) }} } - assert(caught1.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught1.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) val caught2 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should ((not contain ("two" -> 2)) or (not contain ("two" -> 2))) } - assert(caught2.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught2.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) val caught3 = intercept[TestFailedException] { HashMap("one" -> 1, "two" -> 2) should (not contain ("two" -> 2) or not contain ("two" -> 2)) } - assert(caught3.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (two,2)")) + assert(caught3.getMessage === (Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2), and " + Prettifier.default(HashMap("one" -> 1, "two" -> 2)) + " contained element (\"two\", 2)")) } // SKIP-SCALATESTJS,NATIVE-START @@ -1878,7 +1878,7 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map should contain ("three" -> 3) } - assert(caught1.getMessage === decorateToStringValue(prettifier, map) + " did not contain element (three,3)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map) + " did not contain element (\"three\", 3)") } it("should throw TestFailedException if contains the specified element when used with not") { @@ -1886,19 +1886,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] {( map1 should (not contain ("two" -> 2))) } - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " contained element (two,2)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " contained element (\"two\", 2)") val map2 = mutable.HashMap("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] {( map2 should not (contain ("two" -> 2))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " contained element (two,2)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " contained element (\"two\", 2)") val map3 = mutable.HashMap("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] {( map3 should not contain ("two" -> 2)) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " contained element (two,2)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " contained element (\"two\", 2)") } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-and expression") { @@ -1906,19 +1906,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map1 should { contain ("five" -> 5) and (contain ("two" -> 2)) } } - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (five,5)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (\"five\", 5)") val map2 = mutable.HashMap("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] {( map2 should ((contain ("five" -> 5)) and (contain ("two" -> 2)))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (five,5)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (\"five\", 5)") val map3 = mutable.HashMap("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] {( map3 should (contain ("five" -> 5) and contain ("two" -> 2))) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (five,5)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (\"five\", 5)") } it("should throw an TestFailedException when map doesn't contain specified element and used in a logical-or expression") { @@ -1926,19 +1926,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] {( map1 should { contain ("fifty five" -> 55) or (contain ("twenty two" -> 22)) } )} - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (fifty five,55), and " + decorateToStringValue(prettifier, map1) + " did not contain element (twenty two,22)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (\"fifty five\", 55), and " + decorateToStringValue(prettifier, map1) + " did not contain element (\"twenty two\", 22)") val map2 = mutable.HashMap("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] { map2 should ((contain ("fifty five" -> 55)) or (contain ("twenty two" -> 22))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (fifty five,55), and " + decorateToStringValue(prettifier, map2) + " did not contain element (twenty two,22)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (\"fifty five\", 55), and " + decorateToStringValue(prettifier, map2) + " did not contain element (\"twenty two\", 22)") val map3 = mutable.HashMap("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] { map3 should (contain ("fifty five" -> 55) or contain ("twenty two" -> 22)) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (fifty five,55), and " + decorateToStringValue(prettifier, map3) + " did not contain element (twenty two,22)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (\"fifty five\", 55), and " + decorateToStringValue(prettifier, map3) + " did not contain element (\"twenty two\", 22)") } it("should throw an TestFailedException when map contains specified element and used in a logical-and expression with not") { @@ -1946,19 +1946,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map1 should { not { contain ("three" -> 3) } and not { contain ("two" -> 2) }} } - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (three,3), but " + decorateToStringValue(prettifier, map1) + " contained element (two,2)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " did not contain element (\"three\", 3), but " + decorateToStringValue(prettifier, map1) + " contained element (\"two\", 2)") val map2 = mutable.HashMap("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] { map2 should ((not contain ("three" -> 3)) and (not contain ("two" -> 2))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (three,3), but " + decorateToStringValue(prettifier, map2) + " contained element (two,2)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " did not contain element (\"three\", 3), but " + decorateToStringValue(prettifier, map2) + " contained element (\"two\", 2)") val map3 = mutable.HashMap("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] { map3 should (not contain ("three" -> 3) and not contain ("two" -> 2)) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (three,3), but " + decorateToStringValue(prettifier, map3) + " contained element (two,2)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " did not contain element (\"three\", 3), but " + decorateToStringValue(prettifier, map3) + " contained element (\"two\", 2)") } it("should throw an TestFailedException when map contains specified element and used in a logical-or expression with not") { @@ -1966,19 +1966,19 @@ class ShouldContainElementSpec extends AnyFunSpec with PropertyChecks with Retur val caught1 = intercept[TestFailedException] { map1 should { not { contain ("two" -> 2) } or not { contain ("two" -> 2) }} } - assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " contained element (two,2), and " + decorateToStringValue(prettifier, map1) + " contained element (two,2)") + assert(caught1.getMessage === decorateToStringValue(prettifier, map1) + " contained element (\"two\", 2), and " + decorateToStringValue(prettifier, map1) + " contained element (\"two\", 2)") val map2 = mutable.HashMap("one" -> 1, "two" -> 2) val caught2 = intercept[TestFailedException] { map2 should ((not contain ("two" -> 2)) or (not contain ("two" -> 2))) } - assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " contained element (two,2), and " + decorateToStringValue(prettifier, map2) + " contained element (two,2)") + assert(caught2.getMessage === decorateToStringValue(prettifier, map2) + " contained element (\"two\", 2), and " + decorateToStringValue(prettifier, map2) + " contained element (\"two\", 2)") val map3 = mutable.HashMap("one" -> 1, "two" -> 2) val caught3 = intercept[TestFailedException] { map3 should (not contain ("two" -> 2) or not contain ("two" -> 2)) } - assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " contained element (two,2), and " + decorateToStringValue(prettifier, map3) + " contained element (two,2)") + assert(caught3.getMessage === decorateToStringValue(prettifier, map3) + " contained element (\"two\", 2), and " + decorateToStringValue(prettifier, map3) + " contained element (\"two\", 2)") } // SKIP-SCALATESTJS,NATIVE-START From da9d038e80b7fa51522fab3d0a466e0c13a8bea6 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 17:38:24 +0800 Subject: [PATCH 02/10] Work in progress fixing generated tests, remaining failing tests in genContainTests1 and genContainTests2 now. --- project/GenContainBase.scala | 71 ++++++++++++++++-------------------- project/GenFramework.scala | 9 +++-- 2 files changed, 37 insertions(+), 43 deletions(-) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index b0d2d3bc72..339c0a7a47 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -321,13 +321,11 @@ class GenContainBase { "\\(\\\"you\\\", \\\"to\\\"\\)" -> "(\"you\" -> \"you\", \"to\" -> \"to\")", "\\(\\\"YOU\\\", \\\"TO\\\"\\)" -> "(\"YOU\" -> \"YOU\", \"TO\" -> \"TO\")", "\\(\\\" YOU \\\", \\\" TO \\\"\\)" -> "(\" YOU \" -> \" YOU \", \" TO \" -> \" TO \")", - "\\\"\\\\\"happy\\\\\", \\\\\"birthday\\\\\", \\\\\"to\\\\\", \\\\\"you\\\\\\\"\\\"" -> "\"(happy,happy), (birthday,birthday), (to,to), (you,you)\"", "\\\"\\\\\"HAPPY\\\\\", \\\\\"BIRTHDAY\\\\\", \\\\\"TO\\\\\", \\\\\"YOU\\\\\\\"\\\"" -> "\"(HAPPY,HAPPY), (BIRTHDAY,BIRTHDAY), (TO,TO), (YOU,YOU)\"", "\\\\\"ho\\\\\", \\\\\"hey\\\\\", \\\\\"howdy\\\\\"" -> "(ho,ho), (hey,hey), (howdy,howdy)", "\\\\\"ho\\\\\", \\\\\"hello\\\\\"" -> "(ho,ho), (hello,hello)", "\\\\\"hi\\\\\", \\\\\"hey\\\\\", \\\\\"howdy\\\\\"" -> "(hi,hi), (hey,hey), (howdy,howdy)", "\\\\\"hello\\\\\", \\\\\"hi\\\\\"" -> "(hello,hello), (hi,hi)", - "\\\\\"happy\\\\\", \\\\\"birthday\\\\\", \\\\\"to\\\\\", \\\\\"you\\\\\"" -> "(happy,happy), (birthday,birthday), (to,to), (you,you)", "\\\\\"have\\\\\", \\\\\"a\\\\\", \\\\\"nice\\\\\", \\\\\"day\\\\\"" -> "(have,have), (a,a), (nice,nice), (day,day)", "\\\\\"HELLO\\\\\", \\\\\"HI\\\\\"" -> "(HELLO,HELLO), (HI,HI)", "\\\\\"hi\\\\\", \\\\\"he\\\\\"" -> "(hi,hi), (he,he)", @@ -342,19 +340,12 @@ class GenContainBase { "\\\\\"HO\\\\\", \\\\\"HE\\\\\"" -> "(HO,HO), (HE,HE)", "\\\\\"HO\\\\\"" -> "(HO,HO)", "\\\\\"HELLO\\\\\"" -> "(HELLO,HELLO)", - "\\\\\"fee\\\\\", \\\\\"fie\\\\\", \\\\\"foe\\\\\", \\\\\"fum\\\\\"" -> "(fee,fee), (fie,fie), (foe,foe), (fum,fum)", - "\\\\\"fee\\\\\", \\\\\"fum\\\\\", \\\\\"foe\\\\\", \\\\\"fu\\\\\"" -> "(fee,fee), (fum,fum), (foe,foe), (fu,fu)", - "\\\\\"fee\\\\\", \\\\\"fie\\\\\", \\\\\"foe\\\\\", \\\\\"fam\\\\\"" -> "(fee,fee), (fie,fie), (foe,foe), (fam,fam)", - "\\\\\"fee\\\\\", \\\\\"fie\\\\\", \\\\\"fum\\\\\", \\\\\"foe\\\\\"" -> "(fee,fee), (fie,fie), (fum,fum), (foe,foe)", - "\\\\\"fie\\\\\", \\\\\"fee\\\\\", \\\\\"fum\\\\\", \\\\\"foe\\\\\"" -> "(fie,fie), (fee,fee), (fum,fum), (foe,foe)", - "\\\\\"fie\\\\\", \\\\\"fee\\\\\", \\\\\"foe\\\\\", \\\\\"fum\\\\\"" -> "(fie,fie), (fee,fee), (foe,foe), (fum,fum)", - "\\\\\"fie\\\\\", \\\\\"fee\\\\\", \\\\\"fam\\\\\", \\\\\"foe\\\\\"" -> "(fie,fie), (fee,fee), (fam,fam), (foe,foe)", - "\\\\\"fum\\\\\", \\\\\"foe\\\\\", \\\\\"fie\\\\\", \\\\\"fee\\\\\"" -> "(fum,fum), (foe,foe), (fie,fie), (fee,fee)", - "\\\\\"fum\\\\\", \\\\\"fum\\\\\", \\\\\"fum\\\\\", \\\\\"fum\\\\\"" -> "(fum,fum), (fum,fum), (fum,fum), (fum,fum)", - "\\\\\"fum\\\\\", \\\\\"fum\\\\\", \\\\\"fum\\\\\"" -> "(fum,fum), (fum,fum), (fum,fum)", - "\\\\\"fum\\\\\", \\\\\"fum\\\\\"" -> "(fum,fum), (fum,fum)", - "\\\\\"fum\\\\\", \\\\\"foe\\\\\"" -> "(fum,fum), (foe,foe)", - "\\\\\"fum\\\\\"" -> "(fum,fum)", + "\\\\\"fee\\\\\"" -> "(\\\\\"fee\\\\\", \\\\\"fee\\\\\")", + "\\\\\"fie\\\\\"" -> "(\\\\\"fie\\\\\", \\\\\"fie\\\\\")", + "\\\\\"foe\\\\\"" -> "(\\\\\"foe\\\\\", \\\\\"foe\\\\\")", + "\\\\\"fum\\\\\"" -> "(\\\\\"fum\\\\\", \\\\\"fum\\\\\")", + "\\\\\"fu\\\\\"" -> "(\\\\\"fu\\\\\", \\\\\"fu\\\\\")", + "\\\\\"fam\\\\\"" -> "(\\\\\"fam\\\\\", \\\\\"fam\\\\\")", "\\\\\"FEE\\\\\", \\\\\"FIE\\\\\", \\\\\"FOE\\\\\", \\\\\"FUM\\\\\"" -> "(FEE,FEE), (FIE,FIE), (FOE,FOE), (FUM,FUM)", "\\\\\"FEE\\\\\", \\\\\"FIE\\\\\", \\\\\"FOE\\\\\", \\\\\"FUU\\\\\"" -> "(FEE,FEE), (FIE,FIE), (FOE,FOE), (FUU,FUU)", "\\\\\"FEE\\\\\", \\\\\"FIE\\\\\", \\\\\"FOE\\\\\", \\\\\"FAM\\\\\"" -> "(FEE,FEE), (FIE,FIE), (FOE,FOE), (FAM,FAM)", @@ -364,8 +355,10 @@ class GenContainBase { "\\\\\"FIE\\\\\", \\\\\"FEE\\\\\", \\\\\"FAM\\\\\", \\\\\"FOE\\\\\"" -> "(FIE,FIE), (FEE,FEE), (FAM,FAM), (FOE,FOE)", "\\\\\"FIE\\\\\", \\\\\"FEE\\\\\", \\\\\"FOE\\\\\", \\\\\"FUM\\\\\"" -> "(FIE,FIE), (FEE,FEE), (FOE,FOE), (FUM,FUM)", "\\\\\"FUM\\\\\", \\\\\"FOE\\\\\", \\\\\"FIE\\\\\", \\\\\"FEE\\\\\"" -> "(FUM,FUM), (FOE,FOE), (FIE,FIE), (FEE,FEE)", - "\\\\\"you\\\\\"" -> "(you,you)", - "\\\\\"to\\\\\"" -> "(to,to)", + "\\\\\"you\\\\\"" -> "(\\\\\"you\\\\\", \\\\\"you\\\\\")", + "\\\\\"to\\\\\"" -> "(\\\\\"to\\\\\", \\\\\"to\\\\\")", + "\\\\\"birthday\\\\\"" -> "(\\\\\"birthday\\\\\", \\\\\"birthday\\\\\")", + "\\\\\"happy\\\\\"" -> "(\\\\\"happy\\\\\", \\\\\"happy\\\\\")", "of \\(1, 2, 3\\)" -> "of ((1,1), (2,2), (3,3))", "of \\(1, 2, 8\\)" -> "of ((1,1), (2,2), (8,8))", "of \\(1, 3, 4\\)" -> "of ((1,1), (3,3), (4,4))", @@ -384,28 +377,28 @@ class GenContainBase { "of \\(\\\\\"he\\\\\"\\)" -> "of ((he,he))", "of \\(\\\\\"hi\\\\\", \\\\\"hello\\\\\"\\)" -> "of ((hi,hi), (hello,hello))", "of \\(\\\\\"HI\\\\\"\\)" -> "of ((HI,HI))", - "\\\"\\(1, 2, 3\\)\\\"" -> "\"((1,1), (2,2), (3,3))\"", - "\\\"\\(1, 3, 2\\)\\\"" -> "\"((1,1), (3,3), (2,2))\"", - "\\\"\\(1, 3, 4\\)\\\"" -> "\"((1,1), (3,3), (4,4))\"", - "\\\"\\(2, 3, 1\\)\\\"" -> "\"((2,2), (3,3), (1,1))\"", - "\\\"\\(2, 3, 4\\)\\\"" -> "\"((2,2), (3,3), (4,4))\"", - "\\\"\\(2, 3, 8\\)\\\"" -> "\"((2,2), (3,3), (8,8))\"", - "\\\"\\(3, 1, 2\\)\\\"" -> "\"((3,3), (1,1), (2,2))\"", - "\\\"\\(3, 6, 8\\)\\\"" -> "\"((3,3), (6,6), (8,8))\"", - "\\\"\\(4, 2, 3\\)\\\"" -> "\"((4,4), (2,2), (3,3))\"", - "\\(\\\"1, 2, 3\\\"\\)" -> "(\"(1,1), (2,2), (3,3)\")", - "\\(\\\"1, 2, 8\\\"\\)" -> "(\"(1,1), (2,2), (8,8)\")", - "\\(\\\"1, 3, 4\\\"\\)" -> "(\"(1,1), (3,3), (4,4)\")", - "\\(\\\"1, 3, 5\\\"\\)" -> "(\"(1,1), (3,3), (5,5)\")", - "\\(\\\"1, 6, 8\\\"\\)" -> "(\"(1,1), (6,6), (8,8)\")", - "\\(\\\"2, 3, 1\\\"\\)" -> "(\"(2,2), (3,3), (1,1)\")", - "\\(\\\"2, 3, 4\\\"\\)" -> "(\"(2,2), (3,3), (4,4)\")", - "\\(\\\"2, 3, 5\\\"\\)" -> "(\"(2,2), (3,3), (5,5)\")", - "\\(\\\"2, 3, 8\\\"\\)" -> "(\"(2,2), (3,3), (8,8)\")", - "\\(\\\"2, 6, 8\\\"\\)" -> "(\"(2,2), (6,6), (8,8)\")", - "\\(\\\"3, 6, 8\\\"\\)" -> "(\"(3,3), (6,6), (8,8)\")", - "\\(\\\"3, 6, 9\\\"\\)" -> "(\"(3,3), (6,6), (9,9)\")", - "\\(\\\"6, 7, 8\\\"\\)" -> "(\"(6,6), (7,7), (8,8)\")", + "\\\"\\(1, 2, 3\\)\\\"" -> "\"((1, 1), (2, 2), (3, 3))\"", + "\\\"\\(1, 3, 2\\)\\\"" -> "\"((1, 1), (3, 3), (2, 2))\"", + "\\\"\\(1, 3, 4\\)\\\"" -> "\"((1, 1), (3, 3), (4, 4))\"", + "\\\"\\(2, 3, 1\\)\\\"" -> "\"((2, 2), (3, 3), (1, 1))\"", + "\\\"\\(2, 3, 4\\)\\\"" -> "\"((2, 2), (3, 3), (4, 4))\"", + "\\\"\\(2, 3, 8\\)\\\"" -> "\"((2, 2), (3, 3), (8, 8))\"", + "\\\"\\(3, 1, 2\\)\\\"" -> "\"((3, 3), (1, 1), (2, 2))\"", + "\\\"\\(3, 6, 8\\)\\\"" -> "\"((3, 3), (6, 6), (8, 8))\"", + "\\\"\\(4, 2, 3\\)\\\"" -> "\"((4, 4), (2, 2), (3, 3))\"", + "\\(\\\"1, 2, 3\\\"\\)" -> "(\"(1, 1), (2, 2), (3, 3)\")", + "\\(\\\"1, 2, 8\\\"\\)" -> "(\"(1, 1), (2, 2), (8, 8)\")", + "\\(\\\"1, 3, 4\\\"\\)" -> "(\"(1, 1), (3, 3), (4, 4)\")", + "\\(\\\"1, 3, 5\\\"\\)" -> "(\"(1, 1), (3, 3), (5, 5)\")", + "\\(\\\"1, 6, 8\\\"\\)" -> "(\"(1, 1), (6, 6), (8, 8)\")", + "\\(\\\"2, 3, 1\\\"\\)" -> "(\"(2, 2), (3, 3), (1, 1)\")", + "\\(\\\"2, 3, 4\\\"\\)" -> "(\"(2, 2), (3, 3), (4, 4)\")", + "\\(\\\"2, 3, 5\\\"\\)" -> "(\"(2, 2), (3, 3), (5, 5)\")", + "\\(\\\"2, 3, 8\\\"\\)" -> "(\"(2, 2), (3, 3), (8, 8)\")", + "\\(\\\"2, 6, 8\\\"\\)" -> "(\"(2, 2), (6, 6), (8, 8)\")", + "\\(\\\"3, 6, 8\\\"\\)" -> "(\"(3, 3), (6, 6), (8, 8)\")", + "\\(\\\"3, 6, 9\\\"\\)" -> "(\"(3, 3), (6, 6), (9, 9)\")", + "\\(\\\"6, 7, 8\\\"\\)" -> "(\"(6, 6), (7, 7), (8, 8)\")", "List\\(to\\)" -> "scala.collection.mutable.LinkedHashMap(to -> to)", "List\\(ho\\)" -> "scala.collection.mutable.LinkedHashMap(ho -> ho)", "List\\(hi\\)" -> "scala.collection.mutable.LinkedHashMap(hi -> hi)", diff --git a/project/GenFramework.scala b/project/GenFramework.scala index 0e1fc5edd6..3d3e9af189 100644 --- a/project/GenFramework.scala +++ b/project/GenFramework.scala @@ -161,9 +161,10 @@ class RecoverToExceptionIfTemplate(declaration: String, assertion: String, fileN } class MessageTemplate(autoQuoteString: Boolean) extends Template { - def wrapStringIfNecessary(value: Any): String = + def decorateIfNecessary(value: Any): String = value match { case strValue: String if autoQuoteString => "\\\"" + strValue + "\\\"" + case (a, b) => "(" + decorateIfNecessary(a) + ", " + decorateIfNecessary(b) + ")" case other => other.toString } } @@ -181,7 +182,7 @@ abstract class LeftMessageTemplate(left: Any, autoQuoteString: Boolean = true) e abstract class LeftRightMessageTemplate(left: Any, right: Any, autoQuoteString: Boolean = true) extends LeftMessageTemplate(left, autoQuoteString) { val message: String override def toString = - left + message + wrapStringIfNecessary(right) + left + message + decorateIfNecessary(right) } class EqualedMessageTemplate(left: Any, right: Any, autoQuoteString: Boolean = true) extends LeftRightMessageTemplate(left, right, autoQuoteString) { @@ -272,12 +273,12 @@ class WasNotTheSameInstanceAsMessageTemplate(left: Any, right: Any, autoQuoteStr class PropertyHadUnexpectedValueMessageTemplate(propertyName: String, expectedValue: Any, value: Any, target: Any, autoQuoteString: Boolean = true) extends MessageTemplate(autoQuoteString) { override def toString = - "The " + propertyName + " property had value " + wrapStringIfNecessary(value) + ", instead of its expected value " + wrapStringIfNecessary(expectedValue) + ", on object " + wrapStringIfNecessary(target) + "The " + propertyName + " property had value " + decorateIfNecessary(value) + ", instead of its expected value " + decorateIfNecessary(expectedValue) + ", on object " + decorateIfNecessary(target) } class PropertyHadExpectedValueMessageTemplate(propertyName: String, expectedValue: Any, target: Any, autoQuoteString: Boolean = true) extends MessageTemplate(autoQuoteString) { override def toString = - "The " + propertyName + " property had its expected value " + wrapStringIfNecessary(expectedValue) + ", on object " + wrapStringIfNecessary(target) + "The " + propertyName + " property had its expected value " + decorateIfNecessary(expectedValue) + ", on object " + decorateIfNecessary(target) } class HadLengthMessageTemplate(left: Any, right: Any, autoQuoteString: Boolean = true) extends LeftRightMessageTemplate(left, right, autoQuoteString) { From efdd5cb777a4718a5644796317ea906bd7d0689c Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 20:24:39 +0800 Subject: [PATCH 03/10] Fixed more failing tests in generated tests. --- project/GenContainBase.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index 339c0a7a47..16f1a619fa 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -322,16 +322,16 @@ class GenContainBase { "\\(\\\"YOU\\\", \\\"TO\\\"\\)" -> "(\"YOU\" -> \"YOU\", \"TO\" -> \"TO\")", "\\(\\\" YOU \\\", \\\" TO \\\"\\)" -> "(\" YOU \" -> \" YOU \", \" TO \" -> \" TO \")", "\\\"\\\\\"HAPPY\\\\\", \\\\\"BIRTHDAY\\\\\", \\\\\"TO\\\\\", \\\\\"YOU\\\\\\\"\\\"" -> "\"(HAPPY,HAPPY), (BIRTHDAY,BIRTHDAY), (TO,TO), (YOU,YOU)\"", - "\\\\\"ho\\\\\", \\\\\"hey\\\\\", \\\\\"howdy\\\\\"" -> "(ho,ho), (hey,hey), (howdy,howdy)", "\\\\\"ho\\\\\", \\\\\"hello\\\\\"" -> "(ho,ho), (hello,hello)", "\\\\\"hi\\\\\", \\\\\"hey\\\\\", \\\\\"howdy\\\\\"" -> "(hi,hi), (hey,hey), (howdy,howdy)", "\\\\\"hello\\\\\", \\\\\"hi\\\\\"" -> "(hello,hello), (hi,hi)", "\\\\\"have\\\\\", \\\\\"a\\\\\", \\\\\"nice\\\\\", \\\\\"day\\\\\"" -> "(have,have), (a,a), (nice,nice), (day,day)", "\\\\\"HELLO\\\\\", \\\\\"HI\\\\\"" -> "(HELLO,HELLO), (HI,HI)", - "\\\\\"hi\\\\\", \\\\\"he\\\\\"" -> "(hi,hi), (he,he)", - "\\\\\"hi\\\\\"" -> "(hi,hi)", - "\\\\\"ho\\\\\"" -> "(ho,ho)", - "\\\\\"hello\\\\\"" -> "(hello,hello)", + "\\\\\"hi\\\\\"" -> "(\\\\\"hi\\\\\", \\\\\"hi\\\\\")", + "\\\\\"ho\\\\\"" -> "(\\\\\"ho\\\\\", \\\\\"ho\\\\\")", + "\\\\\"hey\\\\\"" -> "(\\\\\"hey\\\\\", \\\\\"hey\\\\\")", + "\\\\\"howdy\\\\\"" -> "(\\\\\"howdy\\\\\", \\\\\"howdy\\\\\")", + "\\\\\"hello\\\\\"" -> "(\\\\\"hello\\\\\", \\\\\"hello\\\\\")", "\\\\\"HO\\\\\", \\\\\"HEY\\\\\", \\\\\"HOWDY\\\\\"" -> "(HO,HO), (HEY,HEY), (HOWDY,HOWDY)", "\\\\\"HE\\\\\", \\\\\"HEY\\\\\", \\\\\"HOWDY\\\\\"" -> "(HE,HE), (HEY,HEY), (HOWDY,HOWDY)", "\\\\\"HE\\\\\", \\\\\"HI\\\\\"" -> "(HE,HE), (HI,HI)", From 3208c05e835e64c7e9fa70b8a8495643f28f1d30 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 20:50:44 +0800 Subject: [PATCH 04/10] Another set of fixes for generated tests. --- project/GenContainBase.scala | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index 16f1a619fa..18922c7b8b 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -359,19 +359,19 @@ class GenContainBase { "\\\\\"to\\\\\"" -> "(\\\\\"to\\\\\", \\\\\"to\\\\\")", "\\\\\"birthday\\\\\"" -> "(\\\\\"birthday\\\\\", \\\\\"birthday\\\\\")", "\\\\\"happy\\\\\"" -> "(\\\\\"happy\\\\\", \\\\\"happy\\\\\")", - "of \\(1, 2, 3\\)" -> "of ((1,1), (2,2), (3,3))", - "of \\(1, 2, 8\\)" -> "of ((1,1), (2,2), (8,8))", - "of \\(1, 3, 4\\)" -> "of ((1,1), (3,3), (4,4))", - "of \\(1, 6, 8\\)" -> "of ((1,1), (6,6), (8,8))", - "of \\(2, 3, 1\\)" -> "of ((2,2), (3,3), (1,1))", - "of \\(2, 3, 4\\)" -> "of ((2,2), (3,3), (4,4))", - "of \\(2, 3, 5\\)" -> "of ((2,2), (3,3), (5,5))", - "of \\(2, 3, 8\\)" -> "of ((2,2), (3,3), (8,8))", - "of \\(2, 6, 8\\)" -> "of ((2,2), (6,6), (8,8))", - "of \\(3, 6, 8\\)" -> "of ((3,3), (6,6), (8,8))", - "of \\(3, 6, 9\\)" -> "of ((3,3), (6,6), (9,9))", - "of \\(4, 3, 2\\)" -> "of ((4,4), (3,3), (2,2))", - "of \\(6, 7, 8\\)" -> "of ((6,6), (7,7), (8,8))", + "of \\(1, 2, 3\\)" -> "of ((1, 1), (2, 2), (3, 3))", + "of \\(1, 2, 8\\)" -> "of ((1, 1), (2, 2), (8, 8))", + "of \\(1, 3, 4\\)" -> "of ((1, 1), (3, 3), (4, 4))", + "of \\(1, 6, 8\\)" -> "of ((1, 1), (6, 6), (8, 8))", + "of \\(2, 3, 1\\)" -> "of ((2, 2), (3, 3), (1, 1))", + "of \\(2, 3, 4\\)" -> "of ((2, 2), (3, 3), (4, 4))", + "of \\(2, 3, 5\\)" -> "of ((2, 2), (3, 3), (5, 5))", + "of \\(2, 3, 8\\)" -> "of ((2, 2), (3, 3), (8, 8))", + "of \\(2, 6, 8\\)" -> "of ((2, 2), (6, 6), (8, 8))", + "of \\(3, 6, 8\\)" -> "of ((3, 3), (6, 6), (8, 8))", + "of \\(3, 6, 9\\)" -> "of ((3, 3), (6, 6), (9, 9))", + "of \\(4, 3, 2\\)" -> "of ((4, 4), (3, 3), (2, 2))", + "of \\(6, 7, 8\\)" -> "of ((6, 6), (7, 7), (8, 8))", "of \\(\\\\\"ho\\\\\"\\)" -> "of ((ho,ho))", "of \\(\\\\\"hi\\\\\"\\)" -> "of ((hi,hi))", "of \\(\\\\\"he\\\\\"\\)" -> "of ((he,he))", From b33bef36b793dd1984b0a08187c7cc0780089160 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 21:32:38 +0800 Subject: [PATCH 05/10] Another set of fixes for generated tests. --- project/GenContainBase.scala | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index 18922c7b8b..1b6ba9a561 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -328,33 +328,29 @@ class GenContainBase { "\\\\\"have\\\\\", \\\\\"a\\\\\", \\\\\"nice\\\\\", \\\\\"day\\\\\"" -> "(have,have), (a,a), (nice,nice), (day,day)", "\\\\\"HELLO\\\\\", \\\\\"HI\\\\\"" -> "(HELLO,HELLO), (HI,HI)", "\\\\\"hi\\\\\"" -> "(\\\\\"hi\\\\\", \\\\\"hi\\\\\")", + "\\\\\"he\\\\\"" -> "(\\\\\"he\\\\\", \\\\\"he\\\\\")", "\\\\\"ho\\\\\"" -> "(\\\\\"ho\\\\\", \\\\\"ho\\\\\")", "\\\\\"hey\\\\\"" -> "(\\\\\"hey\\\\\", \\\\\"hey\\\\\")", "\\\\\"howdy\\\\\"" -> "(\\\\\"howdy\\\\\", \\\\\"howdy\\\\\")", "\\\\\"hello\\\\\"" -> "(\\\\\"hello\\\\\", \\\\\"hello\\\\\")", - "\\\\\"HO\\\\\", \\\\\"HEY\\\\\", \\\\\"HOWDY\\\\\"" -> "(HO,HO), (HEY,HEY), (HOWDY,HOWDY)", - "\\\\\"HE\\\\\", \\\\\"HEY\\\\\", \\\\\"HOWDY\\\\\"" -> "(HE,HE), (HEY,HEY), (HOWDY,HOWDY)", - "\\\\\"HE\\\\\", \\\\\"HI\\\\\"" -> "(HE,HE), (HI,HI)", - "\\\\\"HI\\\\\", \\\\\"HE\\\\\"" -> "(HI,HI), (HE,HE)", - "\\\\\"HI\\\\\"" -> "(HI,HI)", - "\\\\\"HO\\\\\", \\\\\"HE\\\\\"" -> "(HO,HO), (HE,HE)", - "\\\\\"HO\\\\\"" -> "(HO,HO)", - "\\\\\"HELLO\\\\\"" -> "(HELLO,HELLO)", + "\\\\\"HI\\\\\"" -> "(\\\\\"HI\\\\\", \\\\\"HI\\\\\")", + "\\\\\"HE\\\\\"" -> "(\\\\\"HE\\\\\", \\\\\"HE\\\\\")", + "\\\\\"HEY\\\\\"" -> "(\\\\\"HEY\\\\\", \\\\\"HEY\\\\\")", + "\\\\\"HO\\\\\"" -> "(\\\\\"HO\\\\\", \\\\\"HO\\\\\")", + "\\\\\"HOWDY\\\\\"" -> "(\\\\\"HOWDY\\\\\", \\\\\"HOWDY\\\\\")", + "\\\\\"HELLO\\\\\"" -> "(\\\\\"HELLO\\\\\", \\\\\"HELLO\\\\\")", "\\\\\"fee\\\\\"" -> "(\\\\\"fee\\\\\", \\\\\"fee\\\\\")", "\\\\\"fie\\\\\"" -> "(\\\\\"fie\\\\\", \\\\\"fie\\\\\")", "\\\\\"foe\\\\\"" -> "(\\\\\"foe\\\\\", \\\\\"foe\\\\\")", "\\\\\"fum\\\\\"" -> "(\\\\\"fum\\\\\", \\\\\"fum\\\\\")", "\\\\\"fu\\\\\"" -> "(\\\\\"fu\\\\\", \\\\\"fu\\\\\")", "\\\\\"fam\\\\\"" -> "(\\\\\"fam\\\\\", \\\\\"fam\\\\\")", - "\\\\\"FEE\\\\\", \\\\\"FIE\\\\\", \\\\\"FOE\\\\\", \\\\\"FUM\\\\\"" -> "(FEE,FEE), (FIE,FIE), (FOE,FOE), (FUM,FUM)", - "\\\\\"FEE\\\\\", \\\\\"FIE\\\\\", \\\\\"FOE\\\\\", \\\\\"FUU\\\\\"" -> "(FEE,FEE), (FIE,FIE), (FOE,FOE), (FUU,FUU)", - "\\\\\"FEE\\\\\", \\\\\"FIE\\\\\", \\\\\"FOE\\\\\", \\\\\"FAM\\\\\"" -> "(FEE,FEE), (FIE,FIE), (FOE,FOE), (FAM,FAM)", - "\\\\\"FEE\\\\\", \\\\\"FIE\\\\\", \\\\\"FAM\\\\\", \\\\\"FOE\\\\\"" -> "(FEE,FEE), (FIE,FIE), (FAM,FAM), (FOE,FOE)", - "\\\\\"FEE\\\\\", \\\\\"FIE\\\\\", \\\\\"FUM\\\\\", \\\\\"FOE\\\\\"" -> "(FEE,FEE), (FIE,FIE), (FUM,FUM), (FOE,FOE)", - "\\\\\"FIE\\\\\", \\\\\"FEE\\\\\", \\\\\"FUM\\\\\", \\\\\"FOE\\\\\"" -> "(FIE,FIE), (FEE,FEE), (FUM,FUM), (FOE,FOE)", - "\\\\\"FIE\\\\\", \\\\\"FEE\\\\\", \\\\\"FAM\\\\\", \\\\\"FOE\\\\\"" -> "(FIE,FIE), (FEE,FEE), (FAM,FAM), (FOE,FOE)", - "\\\\\"FIE\\\\\", \\\\\"FEE\\\\\", \\\\\"FOE\\\\\", \\\\\"FUM\\\\\"" -> "(FIE,FIE), (FEE,FEE), (FOE,FOE), (FUM,FUM)", - "\\\\\"FUM\\\\\", \\\\\"FOE\\\\\", \\\\\"FIE\\\\\", \\\\\"FEE\\\\\"" -> "(FUM,FUM), (FOE,FOE), (FIE,FIE), (FEE,FEE)", + "\\\\\"FEE\\\\\"" -> "(\\\\\"FEE\\\\\", \\\\\"FEE\\\\\")", + "\\\\\"FIE\\\\\"" -> "(\\\\\"FIE\\\\\", \\\\\"FIE\\\\\")", + "\\\\\"FOE\\\\\"" -> "(\\\\\"FOE\\\\\", \\\\\"FOE\\\\\")", + "\\\\\"FUM\\\\\"" -> "(\\\\\"FUM\\\\\", \\\\\"FUM\\\\\")", + "\\\\\"FU\\\\\"" -> "(\\\\\"FU\\\\\", \\\\\"FU\\\\\")", + "\\\\\"FAM\\\\\"" -> "(\\\\\"FAM\\\\\", \\\\\"FAM\\\\\")", "\\\\\"you\\\\\"" -> "(\\\\\"you\\\\\", \\\\\"you\\\\\")", "\\\\\"to\\\\\"" -> "(\\\\\"to\\\\\", \\\\\"to\\\\\")", "\\\\\"birthday\\\\\"" -> "(\\\\\"birthday\\\\\", \\\\\"birthday\\\\\")", From 1a61ac9d5768d57794a83d6829d0c6869d764d67 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 21:45:10 +0800 Subject: [PATCH 06/10] Another set of fixes for generated tests. --- project/GenContainBase.scala | 3 --- 1 file changed, 3 deletions(-) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index 1b6ba9a561..a73b40b9f8 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -322,9 +322,6 @@ class GenContainBase { "\\(\\\"YOU\\\", \\\"TO\\\"\\)" -> "(\"YOU\" -> \"YOU\", \"TO\" -> \"TO\")", "\\(\\\" YOU \\\", \\\" TO \\\"\\)" -> "(\" YOU \" -> \" YOU \", \" TO \" -> \" TO \")", "\\\"\\\\\"HAPPY\\\\\", \\\\\"BIRTHDAY\\\\\", \\\\\"TO\\\\\", \\\\\"YOU\\\\\\\"\\\"" -> "\"(HAPPY,HAPPY), (BIRTHDAY,BIRTHDAY), (TO,TO), (YOU,YOU)\"", - "\\\\\"ho\\\\\", \\\\\"hello\\\\\"" -> "(ho,ho), (hello,hello)", - "\\\\\"hi\\\\\", \\\\\"hey\\\\\", \\\\\"howdy\\\\\"" -> "(hi,hi), (hey,hey), (howdy,howdy)", - "\\\\\"hello\\\\\", \\\\\"hi\\\\\"" -> "(hello,hello), (hi,hi)", "\\\\\"have\\\\\", \\\\\"a\\\\\", \\\\\"nice\\\\\", \\\\\"day\\\\\"" -> "(have,have), (a,a), (nice,nice), (day,day)", "\\\\\"HELLO\\\\\", \\\\\"HI\\\\\"" -> "(HELLO,HELLO), (HI,HI)", "\\\\\"hi\\\\\"" -> "(\\\\\"hi\\\\\", \\\\\"hi\\\\\")", From 51d7f5a5be918943147f1d5eb16e9354dd8082b4 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 21:54:53 +0800 Subject: [PATCH 07/10] All generated tests under genContainTests1 now green. --- project/GenContainBase.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index a73b40b9f8..b4f9ac3f9e 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -218,6 +218,7 @@ class GenContainBase { "\\(\\\"fee\\\", \\\"fum\\\", \\\"foe\\\", \\\"fu\\\"\\)" -> "(\"fee\" -> \"fee\", \"fum\" -> \"fum\", \"foe\" -> \"foe\", \"fu\" -> \"fu\")", "\\(\\\"fee\\\", \\\"fie\\\", \\\"foe\\\", \\\"fam\\\"\\)" -> "(\"fee\" -> \"fee\", \"fie\" -> \"fie\", \"foe\" -> \"foe\", \"fam\" -> \"fam\")", "\\(\\\"fee\\\", \\\"fie\\\", \\\"fum\\\", \\\"foe\\\"\\)" -> "(\"fee\" -> \"fee\", \"fie\" -> \"fie\", \"fum\" -> \"fum\", \"foe\" -> \"foe\")", + "\\(\\\"fee\\\", \\\"fie\\\", \\\"fam\\\", \\\"foe\\\"\\)" -> "(\"fee\" -> \"fee\", \"fie\" -> \"fie\", \"fam\" -> \"fam\", \"foe\" -> \"foe\")", "\\(\\\"fie\\\", \\\"fee\\\", \\\"fam\\\", \\\"foe\\\"\\)" -> "(\"fie\" -> \"fie\", \"fee\" -> \"fee\", \"fam\" -> \"fam\", \"foe\" -> \"foe\")", "\\(\\\"fum\\\", \\\"foe\\\", \\\"fie\\\", \\\"fee\\\"\\)" -> "(\"fum\" -> \"fum\", \"foe\" -> \"foe\", \"fie\" -> \"fie\", \"fee\" -> \"fee\")", "\\(\\\"fex\\\", \\\"fum\\\", \\\"foe\\\", \\\"fie\\\", \\\"fee\\\"\\)" -> "(\"fex\" -> \"fex\", \"fum\" -> \"fum\", \"foe\" -> \"foe\", \"fie\" -> \"fie\", \"fee\" -> \"fee\")", From 2bc07ac8f6723945e7f88ca25777996f32c02a4f Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 22:05:18 +0800 Subject: [PATCH 08/10] Bring failing tests of genContainTests2 down to 15. --- project/GenContainBase.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index b4f9ac3f9e..7d7681a3f7 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -324,7 +324,6 @@ class GenContainBase { "\\(\\\" YOU \\\", \\\" TO \\\"\\)" -> "(\" YOU \" -> \" YOU \", \" TO \" -> \" TO \")", "\\\"\\\\\"HAPPY\\\\\", \\\\\"BIRTHDAY\\\\\", \\\\\"TO\\\\\", \\\\\"YOU\\\\\\\"\\\"" -> "\"(HAPPY,HAPPY), (BIRTHDAY,BIRTHDAY), (TO,TO), (YOU,YOU)\"", "\\\\\"have\\\\\", \\\\\"a\\\\\", \\\\\"nice\\\\\", \\\\\"day\\\\\"" -> "(have,have), (a,a), (nice,nice), (day,day)", - "\\\\\"HELLO\\\\\", \\\\\"HI\\\\\"" -> "(HELLO,HELLO), (HI,HI)", "\\\\\"hi\\\\\"" -> "(\\\\\"hi\\\\\", \\\\\"hi\\\\\")", "\\\\\"he\\\\\"" -> "(\\\\\"he\\\\\", \\\\\"he\\\\\")", "\\\\\"ho\\\\\"" -> "(\\\\\"ho\\\\\", \\\\\"ho\\\\\")", From abaaa013c2f915d1ae8e6d43257ce14cfdd15026 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 22:12:04 +0800 Subject: [PATCH 09/10] Bring failing tests of genContainTests2 down to 11. --- project/GenContainBase.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index 7d7681a3f7..9085a5f152 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -322,7 +322,7 @@ class GenContainBase { "\\(\\\"you\\\", \\\"to\\\"\\)" -> "(\"you\" -> \"you\", \"to\" -> \"to\")", "\\(\\\"YOU\\\", \\\"TO\\\"\\)" -> "(\"YOU\" -> \"YOU\", \"TO\" -> \"TO\")", "\\(\\\" YOU \\\", \\\" TO \\\"\\)" -> "(\" YOU \" -> \" YOU \", \" TO \" -> \" TO \")", - "\\\"\\\\\"HAPPY\\\\\", \\\\\"BIRTHDAY\\\\\", \\\\\"TO\\\\\", \\\\\"YOU\\\\\\\"\\\"" -> "\"(HAPPY,HAPPY), (BIRTHDAY,BIRTHDAY), (TO,TO), (YOU,YOU)\"", + "\\\"\\\\\"HAPPY\\\\\", \\\\\"BIRTHDAY\\\\\", \\\\\"TO\\\\\", \\\\\"YOU\\\\\\\"\\\"" -> "\"(\\\\\"HAPPY\\\\\", \\\\\"HAPPY\\\\\"), (\\\\\"BIRTHDAY\\\\\", \\\\\"BIRTHDAY\\\\\"), (\\\\\"TO\\\\\", \\\\\"TO\\\\\"), (\\\\\"YOU\\\\\", \\\\\"YOU\\\\\")\"", "\\\\\"have\\\\\", \\\\\"a\\\\\", \\\\\"nice\\\\\", \\\\\"day\\\\\"" -> "(have,have), (a,a), (nice,nice), (day,day)", "\\\\\"hi\\\\\"" -> "(\\\\\"hi\\\\\", \\\\\"hi\\\\\")", "\\\\\"he\\\\\"" -> "(\\\\\"he\\\\\", \\\\\"he\\\\\")", From 3e269bcc2ae63bb66c17fa9292175798508b6578 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Sat, 20 Aug 2022 22:35:45 +0800 Subject: [PATCH 10/10] All generated tests are green now! --- project/GenContainBase.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project/GenContainBase.scala b/project/GenContainBase.scala index 9085a5f152..7d8a29439d 100644 --- a/project/GenContainBase.scala +++ b/project/GenContainBase.scala @@ -212,6 +212,7 @@ class GenContainBase { "List\\(\\\"hey\\\"\\)" -> "scala.collection.mutable.LinkedHashMap(\"hey\" -> \"hey\")", "\\(\\\"fee\\\", \\\"fie\\\", \\\"foe\\\"\\)" -> "(\"fee\" -> \"fee\", \"fie\" -> \"fie\", \"foe\" -> \"foe\")", "\\(\\\"fee\\\", \\\"fie\\\", \\\"foe\\\", \\\"fum\\\"\\)" -> "(\"fee\" -> \"fee\", \"fie\" -> \"fie\", \"foe\" -> \"foe\", \"fum\" -> \"fum\")", + "\\(\\\"fee\\\", \\\"fie\\\", \\\"foe\\\", \\\"fuu\\\"\\)" -> "(\"fee\" -> \"fee\", \"fie\" -> \"fie\", \"foe\" -> \"foe\", \"fuu\" -> \"fuu\")", "\\(\\\"fee\\\", \\\"fie\\\", \\\"foe\\\", \\\"fie\\\", \\\"fum\\\"\\)" -> "(\"fee\" -> \"fee\", \"fie\" -> \"fie\", \"foe\" -> \"foe\", \"fie\" -> \"fie\", \"fum\" -> \"fum\")", "\\(\\\"fie\\\", \\\"fee\\\", \\\"fum\\\", \\\"foe\\\"\\)" -> "(\"fie\" -> \"fie\", \"fee\" -> \"fee\", \"fum\" -> \"fum\", \"foe\" -> \"foe\")", "\\(\\\"fie\\\", \\\"fee\\\", \\\"foe\\\", \\\"fum\\\"\\)" -> "(\"fie\" -> \"fie\", \"fee\" -> \"fee\", \"foe\" -> \"foe\", \"fum\" -> \"fum\")", @@ -341,12 +342,14 @@ class GenContainBase { "\\\\\"foe\\\\\"" -> "(\\\\\"foe\\\\\", \\\\\"foe\\\\\")", "\\\\\"fum\\\\\"" -> "(\\\\\"fum\\\\\", \\\\\"fum\\\\\")", "\\\\\"fu\\\\\"" -> "(\\\\\"fu\\\\\", \\\\\"fu\\\\\")", + "\\\\\"fuu\\\\\"" -> "(\\\\\"fuu\\\\\", \\\\\"fuu\\\\\")", "\\\\\"fam\\\\\"" -> "(\\\\\"fam\\\\\", \\\\\"fam\\\\\")", "\\\\\"FEE\\\\\"" -> "(\\\\\"FEE\\\\\", \\\\\"FEE\\\\\")", "\\\\\"FIE\\\\\"" -> "(\\\\\"FIE\\\\\", \\\\\"FIE\\\\\")", "\\\\\"FOE\\\\\"" -> "(\\\\\"FOE\\\\\", \\\\\"FOE\\\\\")", "\\\\\"FUM\\\\\"" -> "(\\\\\"FUM\\\\\", \\\\\"FUM\\\\\")", "\\\\\"FU\\\\\"" -> "(\\\\\"FU\\\\\", \\\\\"FU\\\\\")", + "\\\\\"FUU\\\\\"" -> "(\\\\\"FUU\\\\\", \\\\\"FUU\\\\\")", "\\\\\"FAM\\\\\"" -> "(\\\\\"FAM\\\\\", \\\\\"FAM\\\\\")", "\\\\\"you\\\\\"" -> "(\\\\\"you\\\\\", \\\\\"you\\\\\")", "\\\\\"to\\\\\"" -> "(\\\\\"to\\\\\", \\\\\"to\\\\\")",