1.10.0 (2026-11-26)
Features
- generate black-box tests in a _test package (-package_test) (#206) (3325c5e), closes #33. Based on #199 by @IlyasYOY.
- The new
-package_testflag (Options.PackageTest) generates tests inpackage <pkg>_testthat import the package under test. It implies-exported. - Calls and types from the package under test are qualified, including inside composite types, receivers and generic instantiations. Works with the default and
testifytemplates; custom templates can use thePackageTestandPackageNamefields. - Functions whose signatures use unexported types, and methods on unexported types, are skipped and reported (
Skipped <func>: <reason>, or the newOptions.OnSkipcallback). Unexported struct fields are left out of receiver setup.
- The new
Bug Fixes
- skip benchmark functions when generating tests (#205) (22dadae), closes #93. Functions taking
*testing.Bno longer produce a test that calls the benchmark.
Behavior changes
- Existing
<pkg>_testtest files are now extended in black-box mode automatically, even without-package_test(#206). Previously gotests added unqualified calls and types to these files, which did not compile. Output for such files changes: calls and types are qualified, only exported functions get tests, and the black-box rules above apply. An existing import of the package, including its alias, is reused. - Adding
-package_testtests to an existing internal (package <pkg>) test file is refused with an error, since it would break that file's tests.