Version 1.3.0
Version 1.3.0 is out now and brings some convenient features for failing equality tests, e.g., @Test x == y
or @Test isequal(x,y)
. When x
and y
have specific types listed below, TestingUtilities
will print out a nicely formatted message about why specifically these two quantities are not equal (similar in spirit to WhyNotEqual.jl).
Strings
If x
and y
are two String
s, the failing test will display the common prefix of x
and y
in green and the subsequently differing suffix in red, e.g.,
If you’re unable to distinguish between red & green text, or you just want to change how the differences are displayed, you can invoke TestingUtilities.set_show_diff_styles
, which accepts any keyword arguments also accepted by Base.printstyled
, e.g.,
DataFrames (Julia 1.9+ only)
If x
and y
are two DataFrames
, the failing test will display the reason that x
and y
are not equal, e.g.,
-
x
andy
have differing column names
-
x
andy
have the same column names but differing number of rows
-
x
andy
have the same column names and number of rows, but differing values
As the DataFrames
package are loaded via package extensions, this feature requires at least Julia 1.9.