waldo

Codecov test coverage R build status

The goal of waldo is to find and concisely describe the difference between a pair of R objects, with the primary goal of making it easier to figure out what’s gone wrong in your unit tests.

waldo::compare() is inspired by all.equal(), but takes additional care to generate actionable insights by:

Comparisons

library(waldo)

When comparing atomic vectors, compare() produces diffs (thanks to diffobj) that highlight additions, deletions, and changes, along with a little context:

Depending on the relative size of the differences and the width of your console you’ll get one of three displays:

When comparing more complex objects, compare() creates an executable code path telling you where the differences lie: