Learn R Programming

ttdo: Extend 'tinytest' with 'diffobj'

What is it?

A package to extend tinytest, a lightweight, no-dependency, full-featured unit testing package, with diffobj which compares R objects with proper diff semantics.

So it tests and compares and, in case of differences, provides informative results.

What does that look like?

Glad you asked:

To test it out yourself, the code is in demo/expect_equal_with_diff.R. If you don't see the same results as above, you may need to manually adjust the diffobj package options. Try options(diffobj.format = "ansi256"). See Controlling Diffs and Their Appearance for more details.

How do install it?

The package is now on CRAN and can be installed via a standard

install.packages("ttdo")

Who wrote it?

Dirk Eddelbuettel and Alton Barbehenn

What license?

GPL (>= 2)

Thanks go to

Mark van der Loo for the excellent tinytest package, Brodie Gaslam for the nifty diffobj package and Michel Lang for checkmate.tinytest demonstrating the extensions mechanism.

Copy Link

Version

Install

install.packages('ttdo')

Monthly Downloads

302

Version

0.0.10

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Dirk Eddelbuettel

Last Published

January 21st, 2025

Functions in ttdo (0.0.10)

ttdo_boolean_and_message_tests

Extensions of boolean and messaging tests from tinytest
expect_equal_with_diff

Test for equality with explicit difference
expect_visual_equal_with_diff

Test for plot equality with 'diff' generation
expect_equal_xl

Extensions of equality tests for tinytest
makeDataFrame

Convert tinytest results to data.frame