Skip to content
Permalink
Browse files

Fix issue with pretty in Printer

  • Loading branch information...
travisbrown committed Sep 10, 2019
1 parent bd0c612 commit 1343e8f0be1e9a67aca8acbb51dbc4bd142f9df2
@@ -200,7 +200,7 @@ final case class Printer(
* Returns a string representation of a pretty-printed JSON value.
*/
@deprecated("Use print", "0.12.0")
final def pretty(json: Json): String = pretty(json)
final def pretty(json: Json): String = print(json)

@transient
private[this] final val sizePredictor: ThreadLocal[Printer.SizePredictor] =
@@ -4,7 +4,11 @@ import io.circe.tests.PrinterSuite

class Spaces2PrinterSuite extends PrinterSuite(Printer.spaces2, parser.`package`) with Spaces2PrinterExample
class Spaces4PrinterSuite extends PrinterSuite(Printer.spaces4, parser.`package`)
class NoSpacesPrinterSuite extends PrinterSuite(Printer.noSpaces, parser.`package`)
class NoSpacesPrinterSuite extends PrinterSuite(Printer.noSpaces, parser.`package`) {
"pretty" should "match print" in forAll { (json: Json) =>
assert(printer.print(json) === printer.pretty(json))
}
}
class UnicodeEscapePrinterSuite extends PrinterSuite(Printer.noSpaces.copy(escapeNonAscii = true), parser.`package`) {
import io.circe.syntax._
"Printing object" should "unicode-escape all non-ASCII chars" in {

0 comments on commit 1343e8f

Please sign in to comment.
You can’t perform that action at this time.