diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 3583939..2e3ecae 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -3,3 +3,6 @@ # Scala Steward: Reformat with scalafmt 3.6.1 fa49859eb2585640b5ed6f1c9cc7c64923bc1a15 + +# Scala Steward: Reformat with scalafmt 3.8.5 +6f13a983a4f12b69820f2b040cad05e68836cef0 diff --git a/.scalafmt.conf b/.scalafmt.conf index 28ddd4f..c46a38e 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.3 +version = 3.8.5 runner.dialect = scala213 continuationIndent.defnSite = 2 docstrings.style = Asterisk diff --git a/circe-yaml-scalayaml/shared/src/test/scala/io/circe/yaml/scalayaml/ParserTests.scala b/circe-yaml-scalayaml/shared/src/test/scala/io/circe/yaml/scalayaml/ParserTests.scala index be7dd28..667aec0 100644 --- a/circe-yaml-scalayaml/shared/src/test/scala/io/circe/yaml/scalayaml/ParserTests.scala +++ b/circe-yaml-scalayaml/shared/src/test/scala/io/circe/yaml/scalayaml/ParserTests.scala @@ -83,7 +83,7 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) } - it should "parse aliases" in { + it should "parse aliases" in assert( Parser .parse( @@ -99,7 +99,6 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) .isRight ) - } "Parser.parseDocuments" should "fail on invalid tagged numbers" in { val result = parser.parseDocuments(new StringReader("!!int 12foo")).toList @@ -177,7 +176,7 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) } - it should "parse when within code point limit" in { + it should "parse when within code point limit" in assert( Parser // 1MB .parse( @@ -189,6 +188,5 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) .isRight ) - } } diff --git a/circe-yaml-v12/src/test/scala/io/circe/yaml/v12/EscapingTests.scala b/circe-yaml-v12/src/test/scala/io/circe/yaml/v12/EscapingTests.scala index 36b4b53..29ecd70 100644 --- a/circe-yaml-v12/src/test/scala/io/circe/yaml/v12/EscapingTests.scala +++ b/circe-yaml-v12/src/test/scala/io/circe/yaml/v12/EscapingTests.scala @@ -67,11 +67,10 @@ class EscapingTests extends AnyFlatSpec with Matchers with ScalaCheckDrivenPrope parse(s1) shouldBe Right(json) } - it should "properly escape JSON string values" in { + it should "properly escape JSON string values" in forAll { (s0: String) => test2(s0) } - } def test3(c: Char): Unit = { val m = Map(c.toString -> c.toInt) diff --git a/circe-yaml-v12/src/test/scala/io/circe/yaml/v12/ParserTests.scala b/circe-yaml-v12/src/test/scala/io/circe/yaml/v12/ParserTests.scala index a74eb80..cb47dcc 100644 --- a/circe-yaml-v12/src/test/scala/io/circe/yaml/v12/ParserTests.scala +++ b/circe-yaml-v12/src/test/scala/io/circe/yaml/v12/ParserTests.scala @@ -122,7 +122,7 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) } - it should "fail to parse too many aliases" in { + it should "fail to parse too many aliases" in assert( Parser .make(Parser.Config(maxAliasesForCollections = 1)) @@ -139,7 +139,6 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) .isLeft ) - } "Parser.parseDocuments" should "fail on invalid tagged numbers" in { val result = parser.parseDocuments(new StringReader("!!int 12foo")).toList @@ -250,7 +249,7 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) } - it should "fail to parse when code point limit is exceeded" in { + it should "fail to parse when code point limit is exceeded" in assert( Parser .make(Parser.Config(codePointLimit = 13)) // 13B @@ -262,5 +261,4 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) .isLeft ) - } } diff --git a/circe-yaml/src/test/scala/io/circe/yaml/EscapingTests.scala b/circe-yaml/src/test/scala/io/circe/yaml/EscapingTests.scala index 8ecee43..c96b602 100644 --- a/circe-yaml/src/test/scala/io/circe/yaml/EscapingTests.scala +++ b/circe-yaml/src/test/scala/io/circe/yaml/EscapingTests.scala @@ -54,10 +54,9 @@ class EscapingTests extends AnyFlatSpec with Matchers with ScalaCheckDrivenPrope repr(Try(parse(s))) shouldBe repr(Success(Right(json))) } - "Escaping" should "properly escape JSON string values (all chars)" in { + "Escaping" should "properly escape JSON string values (all chars)" in // exhaustive test: 65k test cases (Char.MinValue to Char.MaxValue).map(_.toChar).foreach(test1) - } def test2(s0: String): Unit = { val json = s0.asJson @@ -66,11 +65,10 @@ class EscapingTests extends AnyFlatSpec with Matchers with ScalaCheckDrivenPrope parse(s1) shouldBe Right(json) } - it should "properly escape JSON string values" in { + it should "properly escape JSON string values" in forAll { (s0: String) => test2(s0) } - } def test3(c: Char): Unit = { val m = Map(c.toString -> c.toInt) @@ -79,8 +77,7 @@ class EscapingTests extends AnyFlatSpec with Matchers with ScalaCheckDrivenPrope parser.parse(printer.print(o)).right.flatMap(_.as[Map[String, Int]]) shouldBe Right(m) } - it should "properly escape JSON object keys" in { + it should "properly escape JSON object keys" in // exhaustive test: 65k test cases (Char.MinValue to Char.MaxValue).map(_.toChar).foreach(test3) - } } diff --git a/circe-yaml/src/test/scala/io/circe/yaml/ParserTests.scala b/circe-yaml/src/test/scala/io/circe/yaml/ParserTests.scala index 3cd1035..4bb20a0 100644 --- a/circe-yaml/src/test/scala/io/circe/yaml/ParserTests.scala +++ b/circe-yaml/src/test/scala/io/circe/yaml/ParserTests.scala @@ -121,7 +121,7 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) } - it should "fail to parse too many aliases" in { + it should "fail to parse too many aliases" in assert( Parser(maxAliasesForCollections = 1) .parse( @@ -137,7 +137,6 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) .isLeft ) - } "Parser.parseDocuments" should "fail on invalid tagged numbers" in { val result = parser.parseDocuments(new StringReader("!!int 12foo")).toList @@ -274,7 +273,7 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) } - it should "fail to parse when code point limit is exceeded" in { + it should "fail to parse when code point limit is exceeded" in assert( Parser(codePointLimit = 13) // 13B .parse( @@ -285,5 +284,4 @@ class ParserTests extends AnyFlatSpec with Matchers with EitherValues { ) .isLeft ) - } }