pillar (version 0.0.0.9000)

expect_pillar_output: Test helpers

Description

Helper functions for packages that implement their own pillar. expect_pillar_output() is an expectation that allows storing the desired result in a file, and comparing the output with the file contents.

add_special() is not exported, and used only for initializing default values to expect_pillar_output().

Usage

expect_pillar_output(x, ..., filename, xp = add_special(x), xf = pillar(xp,
  ...), crayon = TRUE, output_width = 80L)

add_special(x)

Arguments

x

An object to be formatted.

...

Passed on to pillar() if xf is left at its default.

filename

File name that contains the desired output.

xp

Pass a value here instead of x if you want to omit appending NA and Inf values.

xf

Pass the result of a pillar() call here for full control.

crayon

Color the output?

output_width

Passed on as width to testthat::expect_output_file().