[ANN] TestingUtilities.jl

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 Strings, the failing test will display the common prefix of x and y in green and the subsequently differing suffix in red, e.g.,

string_diff1

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 and y have differing column names
    df_diff1

  • x and y have the same column names but differing number of rows
    df_diff2

  • x and y have the same column names and number of rows, but differing values
    df_diff3

As the DataFrames package are loaded via package extensions, this feature requires at least Julia 1.9.

7 Likes