Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ object HorizontalVersionSpecificTests extends TestSuite{
val tests = TestSuite{
test("Stream") - Check(
Stream('omg, 'wtf, 'bbq),
"""Stream('omg, 'wtf, 'bbq)"""
"""Stream('omg, 'wtf, 'bbq)""",
"""Stream(Symbol(omg), <not computed>)"""
)
}
}
22 changes: 16 additions & 6 deletions pprint/test/src/test/pprint/HorizontalTests.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package test.pprint

import utest._
import pprint.PPrinter

import scala.collection.{mutable, immutable => imm}

Expand Down Expand Up @@ -112,13 +113,22 @@ object HorizontalTests extends TestSuite{
test("Buffer") - Check(
mutable.Buffer("omg", "wtf", "bbq"),
"""ArrayBuffer("omg", "wtf", "bbq")""",
"""WrappedArray("omg", "wtf", "bbq")"""
"""WrappedArray("omg", "wtf", "bbq")""",
"""ArrayDeque("omg", "wtf", "bbq")""",
)

test("stream") - Check(
Stream.continually("foo"),
"""Stream(foo, <not computed>)"""
)
test("stream") - {
val pprinted = fansi.Str.join(
PPrinter.BlackWhite.tokenize(Stream.continually("foo"), 100, 9999).toStream
).plainText

utest.assert(
pprinted == "Stream(foo, <not computed>)" ||
pprinted.startsWith("Stream(") &&
pprinted.contains("foo") &&
pprinted.contains("\n")
)
}

test("Iterable") - Check(Iterable("omg", "wtf", "bbq"), """List("omg", "wtf", "bbq")""")
test("Set") - Check(Set("omg"), """Set("omg")""")
Expand Down Expand Up @@ -151,7 +161,7 @@ object HorizontalTests extends TestSuite{
)

test("StringBuilder") - Check(
mutable.StringBuilder("example"),
new mutable.StringBuilder().append("example"),
""" "example" """
)
}
Expand Down
Loading