Provides many "given" Testable instances for built-in types.
Provided types include
Int,Long,BigInt,DoubleBoolean,Char,StringOption,List,ArraySet,Map(fromscala.collection.immutable)Tuple2, ...,Tuple6
Other types can be added as needed by declaring an appropriate
Testable instance.
Also provides a TestableGrid instance for an array of arrays
that displays its data in a grid-like format.
- Companion:
- class
Type members
Classlikes
Value members
Concrete methods
Provides an easier-to-read display for two-dimensional arrays by formatting them as a grid.
Provides an easier-to-read display for two-dimensional arrays by formatting them as a grid.
For example,
Array(Array(1, 0, 10), Array(-1592, 3, 7), Array(67, 2, 192))
would be displayed as
Array(
Array( 1, 0, 10),
Array(-1592, 3, 7),
Array( 67, 2, 192)
)
If the inner arrays have different lengths, the data will be displayed
in the default format, rather than as a grid. For example, if the
-1592 were removed, the above array of arrays would display as
Array(Array(1, 0, 10), Array(3, 7), Array(67, 2, 192))
Warning: Best used with grids that are small enough not to wrap.
To use this as a replacement for Testable[Array[Array[A]]], precede the
test with a given, as in
given hwtest.Testable[Array[Array[Int]]] = hwtest.Testable.TestableGrid[Int]
test("column", column, "matrix")
However, this can also affect the display of other tests that involve
an Array[Array[Int]. If necessary, you can avoid that by surounding the
given... and test... with { and }.