Skip to content

exampletestr

Help for Writing Unit Tests Based on Function Examples

v1.7.3 · Oct 7, 2024 · GPL-3

Description

Take the examples written in your documentation of functions and use them to create shells (skeletons which must be manually completed by the user) of test files to be tested with the 'testthat' package. Sort of like python 'doctests' for R.

Downloads

CRAN

785

Last 30 days

4105th

2.4K

Last 90 days

9.9K

Last year

Trend: -4.7% (30d vs prior 30d)

r2u CRAN

0

Last 30 days

23

Last 90 days

93

Last year

Trend: -100% (30d vs prior 30d)

autoCRAN

3

Last 7 days

11

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Code

Structure

Lines of code

1,787

Files

40

Compiled share

0%

Has compiled src

No

Language breakdown

R 785 (43.9%)Tests 451 (25.2%)Docs 112 (6.3%)Vignettes 439 (24.6%)

API

Exported functions

3

Internal functions

14

Testing & CI

Has tests

Yes

Test-to-code ratio

0.57

testthat edition

2

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

100%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

0%

Unsafe pattern score

0

Dep constraint coverage

84.6%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5

System requirements

C++ standard

License

GPL-3

License flags

SPDX valid, OSI approved

History

Versions

25

First release

2017-03-18

Latest release

2024-10-07

Avg cadence

82 days

Cold removal rate

100%

Dep drift

54

LOC over versions

v0.3.0: 995 LOCv0.4.0: 1,038 LOCv1.0.0: 1,034 LOCv1.0.1: 1,033 LOCv1.1.0: 1,057 LOCv1.1.1: 1,050 LOCv1.2.0: 920 LOCv1.3.0: 1,177 LOCv1.3.1: 1,177 LOCv1.4.0: 1,467 LOCv1.4.1: 1,502 LOCv1.4.2: 1,241 LOCv1.5.0: 1,620 LOCv1.5.1: 1,612 LOCv1.5.2: 1,612 LOCv1.6.0: 1,843 LOCv1.6.1: 1,844 LOCv1.6.2: 1,870 LOCv1.6.3: 1,870 LOCv1.6.4: 1,872 LOCv1.6.5: 1,876 LOCv1.7.0: 1,876 LOCv1.7.1: 1,878 LOCv1.7.2: 1,882 LOCv1.7.3: 1,787 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies checkmate fs magrittr purrr readr rlang roxygen2 rstudioapi strex stringr styler usethis withr exampletestr

Version History

26 tracked
new 1.7.3 Mar 10, 2026
updated 1.7.3 ← 1.7.2 diff Oct 6, 2024
updated 1.7.2 ← 1.7.1 diff Aug 16, 2024
updated 1.7.1 ← 1.7.0 diff Jun 10, 2023
updated 1.7.0 ← 1.6.5 diff Dec 5, 2022
updated 1.6.5 ← 1.6.4 diff Aug 8, 2021
updated 1.6.4 ← 1.6.3 diff Aug 1, 2021
updated 1.6.3 ← 1.6.2 diff Apr 23, 2021
updated 1.6.2 ← 1.6.1 diff Nov 16, 2020
updated 1.6.1 ← 1.6.0 diff Apr 14, 2020
updated 1.6.0 ← 1.5.2 diff Apr 7, 2020
updated 1.5.2 ← 1.5.1 diff Nov 4, 2019
updated 1.5.1 ← 1.5.0 diff Aug 3, 2019
updated 1.5.0 ← 1.4.2 diff Jul 4, 2019
updated 1.4.2 ← 1.4.1 diff May 30, 2019