https://github.com/eddelbuettel/ttdo
Extend tinytest with diffobj
https://github.com/eddelbuettel/ttdo
diff package r unit-testing
Last synced: 30 days ago
JSON representation
Extend tinytest with diffobj
- Host: GitHub
- URL: https://github.com/eddelbuettel/ttdo
- Owner: eddelbuettel
- Created: 2019-08-26T12:56:26.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-23T23:48:15.000Z (3 months ago)
- Last Synced: 2025-02-26T11:48:35.155Z (about 2 months ago)
- Topics: diff, package, r, unit-testing
- Language: R
- Size: 413 KB
- Stars: 21
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
Awesome Lists containing this project
- jimsghstars - eddelbuettel/ttdo - Extend tinytest with diffobj (R)
README
## ttdo: Extend 'tinytest' with 'diffobj'
[](https://github.com/eddelbuettel/ttdo/actions?query=workflow%3Aci)
[](https://www.gnu.org/licenses/gpl-2.0.html)
[](https://cran.r-project.org/package=ttdo)
[](https://eddelbuettel.r-universe.dev/ttdo)
[](https://cran.r-project.org/package=ttdo)
[](https://www.r-pkg.org/pkg/ttdo)
[](https://github.com/eddelbuettel/ttdo)### What is it?
A package to extend [tinytest](https://cran.r-project.org/package=tinytest), a lightweight, no-dependency, full-featured unit testing package, with
[diffobj](https://cran.r-project.org/package=diffobj) which compares [R](https://www.R-Project.org) 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](https://github.com/eddelbuettel/ttdo/blob/master/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](https://cran.r-project.org/package=diffobj/vignettes/diffobj.html#controlling-diffs-and-their-appearance)
for more details.### How do install it?
The package is now on [CRAN](https://cran.r-project.org) and can be installed
via a standard```r
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](https://cran.r-project.org/package=tinytest) package, Brodie
Gaslam for the nifty [diffobj](https://cran.r-project.org/package=diffobj)
package and Michel Lang for
[checkmate.tinytest](https://github.com/mllg/checkmate.tinytest)
demonstrating the extensions mechanism.