New Upstream Snapshot - r-cran-testextra

Ready changes

Summary

Merged new upstream version: 0.1.0.1+git20200131.1.1d72701 (was: 0.1.0.1).

Resulting package

Built on 2023-01-19T06:11 (took 13m40s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots r-cran-testextra

Lintian Result

Diff

diff --git a/DESCRIPTION b/DESCRIPTION
index 2ce08a8..7bd84a6 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,16 +1,16 @@
 Package: testextra
 Type: Package
 Title: Extract Test Blocks
-Version: 0.1.0.1
+Version: 0.1.0.9000
 Authors@R: c( 
     person("Andrew", "Redd", role = c("aut", "cre")
           , email = "andrew.redd@hsc.utah.edu"
-          , comment = c(ORCID = "https://orcid.org/0000-0002-6149-2438")
+          , comment = c(ORCID = "https://orcid.org/000-0002-6149-2438")
           ), 
-    person("R Documentation Task Force", role=c("cph")
+    person("R Documentation Task Force", role=c("ctb")
           , comment = c(url = "https://rdoctaskforce.github.io/")
           ),
-    person("R Consortium", role="fnd"
+    person("R Consortium", role=c("fnd", "cph")
           , comment = c(url = "https://www.r-consortium.org")
           ))
 Maintainer: Andrew Redd <andrew.redd@hsc.utah.edu>
@@ -20,20 +20,18 @@ Description: A collection of testing enhancements and utilities.
 License: GPL-2
 Encoding: UTF-8
 Language: en-US
-LazyData: true
 Imports: assertthat, methods, parsetools, pkgcond, postlogic, purrr,
         rlang, stringi, testthat, utils
 Suggests: covr, devtools, withr, rstudioapi, htmltools, shiny, yaml, DT
-RoxygenNote: 6.1.1
+Roxygen: list(markdown = TRUE, roclets = c('rd'))
+RoxygenNote: 7.0.2
 Collate: 'extract_tests.R' 'catch_condition.R' 'inheritance.R'
         'new_namespace.R' 'strings.R' 'util-testing.R' 'validity.R'
         'coverage.R'
 URL: https://github.com/RDocTaskForce/testextra
 BugReports: https://github.com/RDocTaskForce/testextra/issues
 NeedsCompilation: no
-Packaged: 2019-12-18 09:12:49 UTC; hornik
-Author: Andrew Redd [aut, cre] (<https://orcid.org/0000-0002-6149-2438>),
-  R Documentation Task Force [cph] (https://rdoctaskforce.github.io/),
-  R Consortium [fnd] (https://www.r-consortium.org)
-Repository: CRAN
-Date/Publication: 2019-12-18 09:15:29 UTC
+Packaged: 2023-01-19 06:04:13 UTC; root
+Author: Andrew Redd [aut, cre] (https://orcid.org/000-0002-6149-2438),
+  R Documentation Task Force [ctb] (https://rdoctaskforce.github.io/),
+  R Consortium [fnd, cph] (https://www.r-consortium.org)
diff --git a/MD5 b/MD5
deleted file mode 100644
index c73b7f6..0000000
--- a/MD5
+++ /dev/null
@@ -1,46 +0,0 @@
-c5842e143930555d5bf61d8a5c9756ba *DESCRIPTION
-42f339482cd9867c025c13382d820a11 *NAMESPACE
-62146256f318bf4d9f0a6c4e1afe3e93 *NEWS.md
-1fb27662d38b56b02001a9388728a882 *R/catch_condition.R
-70a162973887c648893e11508aac1a62 *R/coverage.R
-7452f39c9939e73ec221de9023f64bd7 *R/extract_tests.R
-5391a3c5a88307f46f22f1e52a308b94 *R/inheritance.R
-3062d5ba7f698bafeb550ebfaebb3b59 *R/new_namespace.R
-e89d7220652c4d829446259c4f8465ed *R/strings.R
-5f4e30d3a5a248b40e4c5bce1b9fd7ad *R/util-testing.R
-a854c5708b3524b86db0fbb3f8e28ac1 *R/validity.R
-5e534725328dfec151b73943a3508cea *README.md
-1deaaa20f483fc0f6cf4912584f41102 *inst/WORDLIST
-9afa6da0b7b4017518f05c14d1024b1c *inst/examples/example-class-expectations.R
-68f5632547e60331c9ef31b8698a4d19 *inst/examples/example-class-tests.R
-a426edc09ddc72c5f5dabc81b30bfe65 *inst/examples/example-namespace.R
-6a15203b230057b64f64b83e581bde50 *inst/rstudio/addins.dcf
-2f45c16fffa748e329bacf9565380f08 *inst/testExtractionTest/R/Class.R
-f562dc68e7fdf0009331c6c58252d5e6 *inst/testExtractionTest/R/function.R
-2ff1c89e205b0bfdce40790de32a641d *inst/testExtractionTest/covr-expected/covr-function.html
-86decd04c961f70c09ecb05782552e5a *man/addin_covr_file.Rd
-d59528a39c0e1c56569298266ae805a1 *man/addin_extract_covr.Rd
-cb2bf7f65737d7b2ca96fb109eeffe8b *man/addin_test.Rd
-cc18df9350feb8a62cfc0c0583101387 *man/catch_condition.Rd
-9705d81cddeddb7fa8d8607569405c72 *man/class-expectations.Rd
-1688abc5757820a7b7061aed90d5f724 *man/class-tests.Rd
-25e2e6d19cfb172e8116c20920b7bc60 *man/class0.Rd
-393ae3589cae901a3a198f0bc898b915 *man/covr-rendering-single.Rd
-61f4914fa062e867094fb44ca46ada8f *man/covr-single.Rd
-85b709f69cb6a3def99a3f878bfa37aa *man/covr_files.Rd
-789f23f4b2462bb10ed2b49efd8f6fd3 *man/expect_valid.Rd
-9ae77c79c5f3c82f14704a5c762d41bb *man/extract_tests.Rd
-9789414b122f0236cc35e6ca31e81fa3 *man/figures/logo.png
-b4f406bc461b566d1dd89897d3d43a6b *man/is_valid_regex.Rd
-35ea0c8a0761405585a3edf12c3f5159 *man/namespaces.Rd
-54e57d5cce9d466b40ac895632919991 *man/string-tests.Rd
-8cfc8d781f2806577060d4e749f84f8e *man/test.Rd
-ad1c88469e20abbb5301e26f813e445d *man/validity-tests.Rd
-42b96257e36939414deb5066cdd6e2e4 *tests/testthat.R
-8e87f7cade5a59f2594d872f35a76188 *tests/testthat/test-catch_condition.R
-c4c4d9326513c5475ff11daadf3f4287 *tests/testthat/test-extract_tests.R
-c333afccead0aea43b553bb4fc8d2b6f *tests/testthat/test-inheritance.R
-d1f1fef9e94bc5495e809f499de19217 *tests/testthat/test-new_namespace.R
-a997ab01ceef648b0fd8e79965146e71 *tests/testthat/test-strings.R
-8250b95b805d342b3e8d46fc2619ca73 *tests/testthat/test-util-testing.R
-3d648499a39f5c6fdb30daddc69e860d *tests/testthat/test-validity.R
diff --git a/NEWS.md b/NEWS.md
index 680c3d6..ecb7b84 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,5 @@
+# testextra (development version)
+
 # testextra 0.1
 
 * Added a `NEWS.md` file to track changes to the package.
diff --git a/R/inheritance.R b/R/inheritance.R
index 99a9210..f1e4557 100644
--- a/R/inheritance.R
+++ b/R/inheritance.R
@@ -6,10 +6,10 @@
 #' @description
 #' These tests allow for mapped and enhanced tests regarding class.
 #'
-#' @inheritParams testthat::expect_is
 #' @param object An object to test
 #' @param lst A list of objects to test
 #' @param class The class object is to be, or classes it is allowed to be.
+#' @param label Used to customise failure messages. For expert use only.
 #'
 #' @family class
 #' @example inst/examples/example-class-tests.R
@@ -141,9 +141,9 @@ if(FALSE){#@testing
 #' @description
 #' These extend the [testthat::expect_is] to have finer grain tests.
 #'
-#' @inheritParams testthat::expect_is
 #' @param object the object in question.
 #' @param class the expected class object is to be.
+#' @param label Used to customise failure messages. For expert use only.
 #'
 #' @family class
 #' @example inst/examples/example-class-expectations.R
@@ -151,7 +151,7 @@ NULL
 
 #' @describeIn class-expectations test that an object does **not** inherit from a class.
 expect_is_not <-
-function (object, class, info = NULL, label = NULL){
+function (object, class, label = NULL){
     stopifnot(is.character(class))
     act <- testthat::quasi_label(rlang::enquo(object), label)
     act$class <-
@@ -159,7 +159,7 @@ function (object, class, info = NULL, label = NULL){
     testthat::expect( Negate(is)(act$val, class)
                     , sprintf("%s is a %s; should not inherit from `%s`."
                              , act$lab, act$class, exp_lab)
-                    , info = info)
+                    )
     invisible(act$val)
 }
 if(FALSE){#@testing
@@ -169,7 +169,7 @@ if(FALSE){#@testing
 #' @describeIn class-expectations test that an object is exactly a specific class
 #'  and not a child class.
 expect_is_exactly <-
-function (object, class, info = NULL, label = NULL){
+function (object, class, label = NULL){
     stopifnot(is.character(class))
     act <- testthat::quasi_label(rlang::enquo(object), label)
     act$class <- collapse(class(object), "/")
@@ -177,7 +177,7 @@ function (object, class, info = NULL, label = NULL){
     testthat::expect( is_exactly(act$val, class)
                     , sprintf("%s is a %s; should be exactly a `%s`."
                              , act$lab, act$class, exp_lab)
-                    , info = info)
+                    )
     invisible(act$val)
 }
 if(FALSE){#@testing
@@ -191,17 +191,18 @@ if(FALSE){#@testing
 
     expect_is(x, 'super1')
     expect_error( expect_is_exactly(x, 'super1')
+                , class = 'expectation_failure'
                 , "`x` is a class/super1/super2; should be exactly a `super1`."
                 )
 }
 
 #' @describeIn class-expectations test that all elements of a list inherit a given class.
-expect_all_inherit <- function (object, class, info = NULL, label = NULL) {
+expect_all_inherit <- function (object, class, label = NULL) {
     act <- testthat::quasi_label(rlang::enquo(object), label)
     test <- all_inherit(object, class, label=act$lab)
     testthat::expect( isTRUE(test)
                     , attr(test, 'msg')
-                    , info = info)
+                    )
     invisible(test)
 }
 if(FALSE){#@testing
@@ -211,21 +212,22 @@ if(FALSE){#@testing
              , function()"hello world"
              )
     expect_error( expect_all_inherit(l, 'character')
+                , class='expectation_failure'
                 , "`l` has bad elements at 4, 5, and 6" %<<%
                   "which do not inherit from" %<<%
                   dQuote("character") %<<<% '.')
     expect_error( expect_all_inherit(l, c('character', 'function'))
+                , class='expectation_failure'
                 , "`l` has bad elements at 4 and 5" %<<%
                   "which do not inherit from" %<<%
                   dQuote("character") %<<% 'or' %<<%
                   dQuote("function") %<<<% '.')
     expect_error( expect_all_inherit(l, c('character', 'numeric'))
+                , class='expectation_failure'
                 , "`l` has bad element at 6" %<<%
                   "which does not inherit from" %<<%
                   dQuote("character") %<<% 'or' %<<%
                   dQuote("numeric") %<<<% '.' %<<%
                   "It is a" %<<% dQuote("function"))
-
-
 }
 
diff --git a/R/validity.R b/R/validity.R
index 2887f8e..e8fed31 100644
--- a/R/validity.R
+++ b/R/validity.R
@@ -42,15 +42,14 @@ function(lst, complete=FALSE){
 #' [testthat::test_that()] framework.
 #'
 #' @inheritParams validity-tests
-#' @inheritParams testthat::expect_is
+#' @param label Used to customise failure messages. For expert use only.
 #' @family validity-tests
 expect_valid <-
-function (object, complete=FALSE, info=NULL, label=NULL){
+function (object, complete=FALSE, label=NULL){
     act <- testthat::quasi_label(rlang::enquo(object), label)
     is.valid <- validObject(object, test=TRUE, complete=complete)
     testthat::expect(isTRUE(is.valid)
                     , ._("%s is not valid; %s", act$lab, dQuote(is.valid))
-                    , info=info
                     )
 }
 if(FALSE){#@testing
diff --git a/README.md b/README.md
index 9de90b5..842c2f1 100644
--- a/README.md
+++ b/README.md
@@ -1,107 +1,107 @@
-
-<!-- README.md is generated from README.Rmd. Please edit that file -->
-testextra <img src="man/figures/logo.png" align="right" height=140/>
-====================================================================
-
-[![Travis build status](https://travis-ci.org/RDocTaskForce/testextra.svg?branch=master)](https://travis-ci.org/RDocTaskForce/testextra) [![Coverage](https://codecov.io/github/RDocTaskForce/testextra/coverage.svg?branch=master)](https://codecov.io/github/RDocTaskForce/testextra?branch=master) [![CRAN status](https://www.r-pkg.org/badges/version/testextra)](https://cran.r-project.org/package=testextra) [![life-cycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
-
-The goal of testextra is to facilitate extraction of tests embedded in source code.
-
-Installation
-------------
-
-You will be able to install the released version of testextra from [CRAN](https://CRAN.R-project.org) once it is released with:
-
-``` r
-install.packages("testextra")
-```
-
-Until then or if you wish to get the latest version prior to release you may install directly from GitHub with:
-
-``` r
-remotes::install_github("RDocTaskForce/testextra")
-```
-
-Including Tests in Source Code.
--------------------------------
-
-To include tests in source code put your tests following the function definition nested in an `if(FALSE){...}` block and tag it with a `#@testing` block tag.
-
-``` r
-#' Hello World Example
-hello_world <- function(){
-    message("hello world!")
-}
-if(FALSE){#@testing
-    expect_message(hello_world(), "hello world!")
-}
-```
-
-Assuming the preceding code is in a package file `./R/hello_world.R` running the `extract_tests()` command will create a file `./tests/testthat/test-hello_world.R` with the contents as below.
-
-``` r
-#! This file was automatically produced by the testextra package.
-#! Changes will be overwritten.
-
-context('tests extracted from file `hello_world.R`')
-#line 5 "./R/hello_world.R"
-test_that('hello_world', {#@testing
-    expect_message(hello_world(), "hello world!")
-})
-```
-
-When run, if there are error messages, the line given will be the line and file from the original source code.
-
-Combination Functions
----------------------
-
-The functions `test()` and `test_file()` provided in `testextra` will both extract tests from source files, run said tests, and output the results. `test()` operates on a package as a whole or a subset of a package by
-setting the filter argument, see the help file for details. `test_file()` is intended to work with the [RStudio](http://rstudio.com) GUI. It takes the currently selected file, extracts tests and runs the tests. This way a tests may be run only for the current file being evaluated.
-
-Both `test()` and `test_file()` are available through the add-ins, and made accessible through the menu of RStudio.
-
-Other Helpers
--------------
-
-The 'testextra\` package provides a number of useful testing functions to use when testing code.
-
-### Inheritance
-
--   **`all_inherit()`** - tests if all elements of a list are of the given class or classes.
--   **`are()`** - similar to `all_inherit()`, however uses the `is()` mechanism which is more appropriate for S4 classes.
--   **`is_exactly()`** - Tests if an object is a class, but disallows inheritance.
--   **`all_are_exactly()`** - The `is_exactly()` test mapped over a list of objects.
-
-### Strings
-
--   **`is_nonempty_string()`** - similar to `asssertthat::is.string()` but also ensures that the provided string is not missing (`NA`) and not empty (`""`)
--   **`is_optional_string()`** - same as `is_nonempty_string()` except does allow a character vector of length 0.
-
-### Validity
-
--   **`is_valid()`** - Performs `validObject()` in a manner that is compatible with
-    `validate_that()`, `assert_that()`, or `see_if()` from the `assertthat` package.
--   **`are_valid()`** - `is_valid()` over a list, which when used with the functions listed above gives the indices of objects that are not valid.
--   **`expect_valid()`** - Check validity which is to be used with the `testthat` framework.
-
-### Namespaces
-
-When testing dynamic class creation and modification, it is often necessary to have a package environment other that the package environment in which the creation functions are defined. For this purpose, `testextra` provides these namespace manipulation functions.
-
--   **`new_namespace_env()`** - Create a namespace environment. \*Similar functionality exists in `pkgload`, but is not exposed and registers the namespace by default, which `new_namespace_env()` does not.
--   **`new_pkg_environment()`** - Create a package environment. Technically a namespace does not have to be a package environment, however that is essentially always the case. This function does allow for registration of the environment as a namespace but does not do so by default.
--   **`register_namespace`** - Explicitly register a previously created namespace.
--   **`is_namespace_registered`** - Check if a namespace is registered.
-
-### Others
-
-A few other helpers that do not fit into one of the above categories.
-
--   **`catch_condition()`** - Evaluates code and captures any signals that may be raised. Useful for capturing and subsequently running multiple tests on the error captured, as an alternative to `expect_error()`, `expect_warning()`, and `expect_message()` from the `testthat` package.
--   **`class0`** - retrieve the class of an object as a single string. Separates elements by a '/' if there are more than one. *Same functionality as the `knitr::klass()` function.*
--   **`is_valid_regex`** - Check if a regular expression is valid, not that it does what is intended just that it is valid.
-
-Documentation
--------------
-
-The `testextra` package is developed by the R Documentation Task Force, an [R Consortium](https://www.r-consortium.org) [Infrastructure Steering Committee working group](https://www.r-consortium.org/projects/isc-working-groups).
+
+<!-- README.md is generated from README.Rmd. Please edit that file -->
+testextra <img src="man/figures/logo.png" align="right" height=140/>
+====================================================================
+
+[![Travis build status](https://travis-ci.org/RDocTaskForce/testextra.svg?branch=master)](https://travis-ci.org/RDocTaskForce/testextra) [![Coverage](https://codecov.io/github/RDocTaskForce/testextra/coverage.svg?branch=master)](https://codecov.io/github/RDocTaskForce/testextra?branch=master) [![CRAN status](https://www.r-pkg.org/badges/version/testextra)](https://cran.r-project.org/package=testextra) [![life-cycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
+
+The goal of testextra is to facilitate extraction of tests embedded in source code.
+
+Installation
+------------
+
+You will be able to install the released version of testextra from [CRAN](https://CRAN.R-project.org) once it is released with:
+
+``` r
+install.packages("testextra")
+```
+
+Until then or if you wish to get the latest version prior to release you may install directly from GitHub with:
+
+``` r
+remotes::install_github("RDocTaskForce/testextra")
+```
+
+Including Tests in Source Code.
+-------------------------------
+
+To include tests in source code put your tests following the function definition nested in an `if(FALSE){...}` block and tag it with a `#@testing` block tag.
+
+``` r
+#' Hello World Example
+hello_world <- function(){
+    message("hello world!")
+}
+if(FALSE){#@testing
+    expect_message(hello_world(), "hello world!")
+}
+```
+
+Assuming the preceding code is in a package file `./R/hello_world.R` running the `extract_tests()` command will create a file `./tests/testthat/test-hello_world.R` with the contents as below.
+
+``` r
+#! This file was automatically produced by the testextra package.
+#! Changes will be overwritten.
+
+context('tests extracted from file `hello_world.R`')
+#line 5 "./R/hello_world.R"
+test_that('hello_world', {#@testing
+    expect_message(hello_world(), "hello world!")
+})
+```
+
+When run, if there are error messages, the line given will be the line and file from the original source code.
+
+Combination Functions
+---------------------
+
+The functions `test()` and `test_file()` provided in `testextra` will both extract tests from source files, run said tests, and output the results. `test()` operates on a package as a whole or a subset of a package by
+setting the filter argument, see the help file for details. `test_file()` is intended to work with the [RStudio](http://rstudio.com) GUI. It takes the currently selected file, extracts tests and runs the tests. This way a tests may be run only for the current file being evaluated.
+
+Both `test()` and `test_file()` are available through the add-ins, and made accessible through the menu of RStudio.
+
+Other Helpers
+-------------
+
+The 'testextra\` package provides a number of useful testing functions to use when testing code.
+
+### Inheritance
+
+-   **`all_inherit()`** - tests if all elements of a list are of the given class or classes.
+-   **`are()`** - similar to `all_inherit()`, however uses the `is()` mechanism which is more appropriate for S4 classes.
+-   **`is_exactly()`** - Tests if an object is a class, but disallows inheritance.
+-   **`all_are_exactly()`** - The `is_exactly()` test mapped over a list of objects.
+
+### Strings
+
+-   **`is_nonempty_string()`** - similar to `asssertthat::is.string()` but also ensures that the provided string is not missing (`NA`) and not empty (`""`)
+-   **`is_optional_string()`** - same as `is_nonempty_string()` except does allow a character vector of length 0.
+
+### Validity
+
+-   **`is_valid()`** - Performs `validObject()` in a manner that is compatible with
+    `validate_that()`, `assert_that()`, or `see_if()` from the `assertthat` package.
+-   **`are_valid()`** - `is_valid()` over a list, which when used with the functions listed above gives the indices of objects that are not valid.
+-   **`expect_valid()`** - Check validity which is to be used with the `testthat` framework.
+
+### Namespaces
+
+When testing dynamic class creation and modification, it is often necessary to have a package environment other that the package environment in which the creation functions are defined. For this purpose, `testextra` provides these namespace manipulation functions.
+
+-   **`new_namespace_env()`** - Create a namespace environment. \*Similar functionality exists in `pkgload`, but is not exposed and registers the namespace by default, which `new_namespace_env()` does not.
+-   **`new_pkg_environment()`** - Create a package environment. Technically a namespace does not have to be a package environment, however that is essentially always the case. This function does allow for registration of the environment as a namespace but does not do so by default.
+-   **`register_namespace`** - Explicitly register a previously created namespace.
+-   **`is_namespace_registered`** - Check if a namespace is registered.
+
+### Others
+
+A few other helpers that do not fit into one of the above categories.
+
+-   **`catch_condition()`** - Evaluates code and captures any signals that may be raised. Useful for capturing and subsequently running multiple tests on the error captured, as an alternative to `expect_error()`, `expect_warning()`, and `expect_message()` from the `testthat` package.
+-   **`class0`** - retrieve the class of an object as a single string. Separates elements by a '/' if there are more than one. *Same functionality as the `knitr::klass()` function.*
+-   **`is_valid_regex`** - Check if a regular expression is valid, not that it does what is intended just that it is valid.
+
+Documentation
+-------------
+
+The `testextra` package is developed by the R Documentation Task Force, an [R Consortium](https://www.r-consortium.org) [Infrastructure Steering Committee working group](https://www.r-consortium.org/projects/isc-working-groups).
diff --git a/debian/changelog b/debian/changelog
index 38c449f..95923e6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+r-cran-testextra (0.1.0.1+git20200131.1.1d72701-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 19 Jan 2023 06:04:46 -0000
+
 r-cran-testextra (0.1.0.1-3) unstable; urgency=medium
 
   * Trim trailing whitespace.
diff --git a/inst/WORDLIST b/inst/WORDLIST
index df87f61..7dc2767 100644
--- a/inst/WORDLIST
+++ b/inst/WORDLIST
@@ -1 +1 @@
-RStudio
+RStudio
diff --git a/man/addin_covr_file.Rd b/man/addin_covr_file.Rd
index e52daf7..de90afb 100644
--- a/man/addin_covr_file.Rd
+++ b/man/addin_covr_file.Rd
@@ -1,11 +1,11 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coverage.R
-\name{addin_covr_file}
-\alias{addin_covr_file}
-\title{Add-in for \code{covr_file}}
-\usage{
-addin_covr_file()
-}
-\description{
-This allows for \link{covr_file} to be run from a menu in RStudio.
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/coverage.R
+\name{addin_covr_file}
+\alias{addin_covr_file}
+\title{Add-in for \code{covr_file}}
+\usage{
+addin_covr_file()
+}
+\description{
+This allows for \link{covr_file} to be run from a menu in RStudio.
+}
diff --git a/man/addin_extract_covr.Rd b/man/addin_extract_covr.Rd
index b5371e4..e94588a 100644
--- a/man/addin_extract_covr.Rd
+++ b/man/addin_extract_covr.Rd
@@ -1,11 +1,11 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coverage.R
-\name{addin_extract_covr}
-\alias{addin_extract_covr}
-\title{Add-in for Extract & Coverage}
-\usage{
-addin_extract_covr()
-}
-\description{
-Add-in for Extract & Coverage
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/coverage.R
+\name{addin_extract_covr}
+\alias{addin_extract_covr}
+\title{Add-in for Extract & Coverage}
+\usage{
+addin_extract_covr()
+}
+\description{
+Add-in for Extract & Coverage
+}
diff --git a/man/addin_test.Rd b/man/addin_test.Rd
index a595bc9..0270d05 100644
--- a/man/addin_test.Rd
+++ b/man/addin_test.Rd
@@ -1,14 +1,14 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/extract_tests.R
-\name{addin_test}
-\alias{addin_test}
-\alias{addin_test_file}
-\title{RStudio add-ins}
-\usage{
-addin_test()
-
-addin_test_file()
-}
-\description{
-RStudio add-ins
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/extract_tests.R
+\name{addin_test}
+\alias{addin_test}
+\alias{addin_test_file}
+\title{RStudio add-ins}
+\usage{
+addin_test()
+
+addin_test_file()
+}
+\description{
+RStudio add-ins
+}
diff --git a/man/catch_condition.Rd b/man/catch_condition.Rd
index eb93c41..bfcdaaf 100644
--- a/man/catch_condition.Rd
+++ b/man/catch_condition.Rd
@@ -1,35 +1,35 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/catch_condition.R
-\name{catch_condition}
-\alias{catch_condition}
-\alias{catch_all_conditions}
-\title{Catch a condition for testing.}
-\usage{
-catch_condition(code)
-
-catch_all_conditions(code)
-}
-\arguments{
-\item{code}{code to run that should assert a condition.}
-}
-\description{
-This function captures a condition object such as a warning or
-error, to allow for testing components and classes.
-}
-\examples{
-(cond <- catch_condition(stop("catch me.")))
-class(cond)
-
-my_fun <- function(){
-    message("a message")
-    warning("a warning")
-    pkg_message("a package message", scope="test")
-    pkg_warning("a package warning", scope="test")
-    pkg_error("a package error", scope='test')
-}
-conditions <- catch_all_conditions(my_fun())
-conditions$messages
-conditions$warnings
-conditions$error  # only one error can be caught at a time.
-
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/catch_condition.R
+\name{catch_condition}
+\alias{catch_condition}
+\alias{catch_all_conditions}
+\title{Catch a condition for testing.}
+\usage{
+catch_condition(code)
+
+catch_all_conditions(code)
+}
+\arguments{
+\item{code}{code to run that should assert a condition.}
+}
+\description{
+This function captures a condition object such as a warning or
+error, to allow for testing components and classes.
+}
+\examples{
+(cond <- catch_condition(stop("catch me.")))
+class(cond)
+
+my_fun <- function(){
+    message("a message")
+    warning("a warning")
+    pkg_message("a package message", scope="test")
+    pkg_warning("a package warning", scope="test")
+    pkg_error("a package error", scope='test')
+}
+conditions <- catch_all_conditions(my_fun())
+conditions$messages
+conditions$warnings
+conditions$error  # only one error can be caught at a time.
+
+}
diff --git a/man/class-expectations.Rd b/man/class-expectations.Rd
index f941933..ea9c06c 100644
--- a/man/class-expectations.Rd
+++ b/man/class-expectations.Rd
@@ -1,55 +1,53 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/inheritance.R
-\name{class-expectations}
-\alias{class-expectations}
-\alias{expect_is_not}
-\alias{expect_is_exactly}
-\alias{expect_all_inherit}
-\title{Class Expectations}
-\usage{
-expect_is_not(object, class, info = NULL, label = NULL)
-
-expect_is_exactly(object, class, info = NULL, label = NULL)
-
-expect_all_inherit(object, class, info = NULL, label = NULL)
-}
-\arguments{
-\item{object}{the object in question.}
-
-\item{class}{the expected class object is to be.}
-
-\item{info}{extra information to be included in the message (useful when
-writing tests in loops).}
-
-\item{label}{object label. When \code{NULL}, computed from deparsed object.}
-}
-\description{
-These extend the \link[testthat:expect_is]{testthat::expect_is} to have finer grain tests.
-}
-\section{Functions}{
-\itemize{
-\item \code{expect_is_not}: test that an object does \strong{not} inherit from a class.
-
-\item \code{expect_is_exactly}: test that an object is exactly a specific class
-and not a child class.
-
-\item \code{expect_all_inherit}: test that all elements of a list inherit a given class.
-}}
-
-\examples{
-
-# Test to make sure an object is not of a class.
-\dontrun{
-# will return an error.
-expect_is_not(1L, "numeric")
-}
-
-# but this is fine.
-expect_is_not('a', "numeric")
-
-expect_is_exactly('a', "character")
-}
-\seealso{
-Other class: \code{\link{class-tests}}
-}
-\concept{class}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/inheritance.R
+\name{class-expectations}
+\alias{class-expectations}
+\alias{expect_is_not}
+\alias{expect_is_exactly}
+\alias{expect_all_inherit}
+\title{Class Expectations}
+\usage{
+expect_is_not(object, class, label = NULL)
+
+expect_is_exactly(object, class, label = NULL)
+
+expect_all_inherit(object, class, label = NULL)
+}
+\arguments{
+\item{object}{the object in question.}
+
+\item{class}{the expected class object is to be.}
+
+\item{label}{Used to customise failure messages. For expert use only.}
+}
+\description{
+These extend the \link[testthat:expect_is]{testthat::expect_is} to have finer grain tests.
+}
+\section{Functions}{
+\itemize{
+\item \code{expect_is_not}: test that an object does \strong{not} inherit from a class.
+
+\item \code{expect_is_exactly}: test that an object is exactly a specific class
+and not a child class.
+
+\item \code{expect_all_inherit}: test that all elements of a list inherit a given class.
+}}
+
+\examples{
+
+# Test to make sure an object is not of a class.
+\dontrun{
+# will return an error.
+expect_is_not(1L, "numeric")
+}
+
+# but this is fine.
+expect_is_not('a', "numeric")
+
+expect_is_exactly('a', "character")
+}
+\seealso{
+Other class: 
+\code{\link{class-tests}}
+}
+\concept{class}
diff --git a/man/class-tests.Rd b/man/class-tests.Rd
index f7cb4df..a134cfe 100644
--- a/man/class-tests.Rd
+++ b/man/class-tests.Rd
@@ -1,66 +1,67 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/inheritance.R
-\name{class-tests}
-\alias{class-tests}
-\alias{all_inherit}
-\alias{are}
-\alias{is_exactly}
-\alias{all_are_exactly}
-\title{Enhanced Class Tests}
-\usage{
-all_inherit(lst, class, label = NULL)
-
-are(lst, class)
-
-is_exactly(object, class)
-
-all_are_exactly(lst, class, label = NULL)
-}
-\arguments{
-\item{lst}{A list of objects to test}
-
-\item{class}{The class object is to be, or classes it is allowed to be.}
-
-\item{label}{object label. When \code{NULL}, computed from deparsed object.}
-
-\item{object}{An object to test}
-}
-\description{
-These tests allow for mapped and enhanced tests regarding class.
-}
-\section{Functions}{
-\itemize{
-\item \code{all_inherit}: Check if all elements of a list are or inherit from the given class.
-Uses \code{\link[base:inherits]{base::inherits()}} to check inheritance.
-
-\item \code{are}: \link[methods:is]{methods::is} mapped over a vector.
-Similar to \code{all_inherit} but uses \code{\link[methods:is]{methods::is()}} for test.
-This manifests in S4 Virtual classes such as the 'ANY' class
-
-\item \code{is_exactly}: Test that an object is exactly a class; excludes inheritance.
-
-\item \code{all_are_exactly}: Version of \code{is_exactly} for all elements of a list.
-}}
-
-\examples{
-lst <- list(1L, 2, TRUE)
-
-# all_inherit uses `inherits`
-all_inherit(lst, 'numeric')
-all_inherit(lst, 'integer')
-all_inherit(lst, 'ANY')
-
-# are uses `is` so gets different results.
-are(lst, "numeric")
-are(lst, "integer")
-are(lst, "ANY")
-
-# is_exactly the class must match exactly
-is_exactly(1L, "integer")
-# no inheritance allowed
-is_exactly(1L, "numeric")
-}
-\seealso{
-Other class: \code{\link{class-expectations}}
-}
-\concept{class}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/inheritance.R
+\name{class-tests}
+\alias{class-tests}
+\alias{all_inherit}
+\alias{are}
+\alias{is_exactly}
+\alias{all_are_exactly}
+\title{Enhanced Class Tests}
+\usage{
+all_inherit(lst, class, label = NULL)
+
+are(lst, class)
+
+is_exactly(object, class)
+
+all_are_exactly(lst, class, label = NULL)
+}
+\arguments{
+\item{lst}{A list of objects to test}
+
+\item{class}{The class object is to be, or classes it is allowed to be.}
+
+\item{label}{Used to customise failure messages. For expert use only.}
+
+\item{object}{An object to test}
+}
+\description{
+These tests allow for mapped and enhanced tests regarding class.
+}
+\section{Functions}{
+\itemize{
+\item \code{all_inherit}: Check if all elements of a list are or inherit from the given class.
+Uses \code{\link[base:inherits]{base::inherits()}} to check inheritance.
+
+\item \code{are}: \link[methods:is]{methods::is} mapped over a vector.
+Similar to \code{all_inherit} but uses \code{\link[methods:is]{methods::is()}} for test.
+This manifests in S4 Virtual classes such as the 'ANY' class
+
+\item \code{is_exactly}: Test that an object is exactly a class; excludes inheritance.
+
+\item \code{all_are_exactly}: Version of \code{is_exactly} for all elements of a list.
+}}
+
+\examples{
+lst <- list(1L, 2, TRUE)
+
+# all_inherit uses `inherits`
+all_inherit(lst, 'numeric')
+all_inherit(lst, 'integer')
+all_inherit(lst, 'ANY')
+
+# are uses `is` so gets different results.
+are(lst, "numeric")
+are(lst, "integer")
+are(lst, "ANY")
+
+# is_exactly the class must match exactly
+is_exactly(1L, "integer")
+# no inheritance allowed
+is_exactly(1L, "numeric")
+}
+\seealso{
+Other class: 
+\code{\link{class-expectations}}
+}
+\concept{class}
diff --git a/man/class0.Rd b/man/class0.Rd
index c10d152..5aec65d 100644
--- a/man/class0.Rd
+++ b/man/class0.Rd
@@ -1,14 +1,14 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/util-testing.R
-\name{class0}
-\alias{class0}
-\title{Extract class as a single string.}
-\usage{
-class0(x)
-}
-\arguments{
-\item{x}{any object.}
-}
-\description{
-Extract class as a single string.
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/util-testing.R
+\name{class0}
+\alias{class0}
+\title{Extract class as a single string.}
+\usage{
+class0(x)
+}
+\arguments{
+\item{x}{any object.}
+}
+\description{
+Extract class as a single string.
+}
diff --git a/man/covr-rendering-single.Rd b/man/covr-rendering-single.Rd
index db9855c..f970612 100644
--- a/man/covr-rendering-single.Rd
+++ b/man/covr-rendering-single.Rd
@@ -1,43 +1,47 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coverage.R
-\name{covr-rendering-single}
-\alias{covr-rendering-single}
-\alias{.renderSourceRow}
-\alias{.renderSourceFile}
-\alias{.single_file_summary}
-\alias{.renderReport}
-\title{Rendering for single file report}
-\usage{
-.renderSourceRow(line, source, coverage)
-
-.renderSourceFile(lines, file = "source", highlight = TRUE)
-
-.single_file_summary(file_stats)
-
-.renderReport(coverage, report.file, dir = dirname(report.file),
-  libdir = file.path(dir, "lib"))
-}
-\arguments{
-\item{line, lines}{Line(s) number}
-
-\item{source}{source file}
-
-\item{coverage}{The number of times covered}
-
-\item{file}{the file in question}
-
-\item{highlight}{Highlight the row.}
-
-\item{file_stats}{The coverage object for the file.}
-
-\item{report.file}{Where to output the HTML report.}
-
-\item{dir}{the base directory for the HTML output}
-
-\item{libdir}{Where to put html dependencies?}
-}
-\description{
-These functions facilitate the creation of reports for coverage of a
-single file.
-}
-\concept{coverage}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/coverage.R
+\name{covr-rendering-single}
+\alias{covr-rendering-single}
+\alias{.renderSourceRow}
+\alias{.renderSourceFile}
+\alias{.single_file_summary}
+\alias{.renderReport}
+\title{Rendering for single file report}
+\usage{
+.renderSourceRow(line, source, coverage)
+
+.renderSourceFile(lines, file = "source", highlight = TRUE)
+
+.single_file_summary(file_stats)
+
+.renderReport(
+  coverage,
+  report.file,
+  dir = dirname(report.file),
+  libdir = file.path(dir, "lib")
+)
+}
+\arguments{
+\item{line, lines}{Line(s) number}
+
+\item{source}{source file}
+
+\item{coverage}{The number of times covered}
+
+\item{file}{the file in question}
+
+\item{highlight}{Highlight the row.}
+
+\item{file_stats}{The coverage object for the file.}
+
+\item{report.file}{Where to output the HTML report.}
+
+\item{dir}{the base directory for the HTML output}
+
+\item{libdir}{Where to put html dependencies?}
+}
+\description{
+These functions facilitate the creation of reports for coverage of a
+single file.
+}
+\concept{coverage}
diff --git a/man/covr-single.Rd b/man/covr-single.Rd
index 257114a..67817ef 100644
--- a/man/covr-single.Rd
+++ b/man/covr-single.Rd
@@ -1,49 +1,52 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coverage.R
-\name{covr-single}
-\alias{covr-single}
-\alias{file_coverage}
-\alias{covr_file}
-\title{Single File Coverage}
-\usage{
-file_coverage(file = rstudioapi::getSourceEditorContext()$path,
-  pkg = ".", ...)
-
-covr_file(coverage = file_coverage(), report.file = NULL,
-  show.report = interactive())
-}
-\arguments{
-\item{file}{The file to extract test from and compute coverage.}
-
-\item{pkg}{The package \code{file} is associated with.}
-
-\item{...}{Arguments passed on to \code{covr::file_coverage}
-\describe{
-  \item{source_files}{Character vector of source files with function
-definitions to measure coverage}
-  \item{test_files}{Character vector of test files with code to test the
-functions}
-  \item{line_exclusions}{a named list of files with the lines to exclude from
-each file.}
-  \item{function_exclusions}{a vector of regular expressions matching function
-names to exclude. Example \code{print\\\\.} to match print methods.}
-  \item{parent_env}{The parent environment to use when sourcing the files.}
-}}
-
-\item{coverage}{Coverage returned from \code{file_coverage()}.}
-
-\item{report.file}{Where to save the HTML report.}
-
-\item{show.report}{if the HTML report should be displayed.}
-}
-\description{
-These functions extract tests, run tests and create a report of the coverage for
-a single file.
-}
-\section{Functions}{
-\itemize{
-\item \code{file_coverage}: Extract tests and compute the coverage for the given file.
-
-\item \code{covr_file}: Create a report for a single
-}}
-
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/coverage.R
+\name{covr-single}
+\alias{covr-single}
+\alias{file_coverage}
+\alias{covr_file}
+\title{Single File Coverage}
+\usage{
+file_coverage(file = rstudioapi::getSourceEditorContext()$path, pkg = ".", ...)
+
+covr_file(
+  coverage = file_coverage(),
+  report.file = NULL,
+  show.report = interactive()
+)
+}
+\arguments{
+\item{file}{The file to extract test from and compute coverage.}
+
+\item{pkg}{The package \code{file} is associated with.}
+
+\item{...}{
+  Arguments passed on to \code{\link[covr:file_coverage]{covr::file_coverage}}
+  \describe{
+    \item{\code{source_files}}{Character vector of source files with function
+definitions to measure coverage}
+    \item{\code{test_files}}{Character vector of test files with code to test the
+functions}
+    \item{\code{line_exclusions}}{a named list of files with the lines to exclude from
+each file.}
+    \item{\code{function_exclusions}}{a vector of regular expressions matching function
+names to exclude. Example \verb{print\\\\\\.} to match print methods.}
+    \item{\code{parent_env}}{The parent environment to use when sourcing the files.}
+  }}
+
+\item{coverage}{Coverage returned from \code{file_coverage()}.}
+
+\item{report.file}{Where to save the HTML report.}
+
+\item{show.report}{if the HTML report should be displayed.}
+}
+\description{
+These functions extract tests, run tests and create a report of the coverage for
+a single file.
+}
+\section{Functions}{
+\itemize{
+\item \code{file_coverage}: Extract tests and compute the coverage for the given file.
+
+\item \code{covr_file}: Create a report for a single
+}}
+
diff --git a/man/covr_files.Rd b/man/covr_files.Rd
index 0d2487e..fc92a21 100644
--- a/man/covr_files.Rd
+++ b/man/covr_files.Rd
@@ -1,18 +1,18 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coverage.R
-\name{covr_files}
-\alias{covr_files}
-\title{Compute coverage for a group of files.}
-\usage{
-covr_files(filter, pkg = ".", report = TRUE)
-}
-\arguments{
-\item{filter}{A regular expression filter to apply to the files from \code{pkg}.}
-
-\item{pkg}{The package to compute coverage for.}
-
-\item{report}{If a report should be constructed and shown.}
-}
-\description{
-Compute coverage for a group of files.
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/coverage.R
+\name{covr_files}
+\alias{covr_files}
+\title{Compute coverage for a group of files.}
+\usage{
+covr_files(filter, pkg = ".", report = TRUE)
+}
+\arguments{
+\item{filter}{A regular expression filter to apply to the files from \code{pkg}.}
+
+\item{pkg}{The package to compute coverage for.}
+
+\item{report}{If a report should be constructed and shown.}
+}
+\description{
+Compute coverage for a group of files.
+}
diff --git a/man/expect_valid.Rd b/man/expect_valid.Rd
index ca66bff..e1f0e29 100644
--- a/man/expect_valid.Rd
+++ b/man/expect_valid.Rd
@@ -1,27 +1,25 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/validity.R
-\name{expect_valid}
-\alias{expect_valid}
-\title{Expect an S4 object is valid}
-\usage{
-expect_valid(object, complete = FALSE, info = NULL, label = NULL)
-}
-\arguments{
-\item{object}{an S4 object to test for validity}
-
-\item{complete}{logical; if \code{TRUE}, \code{validObject} is
-      called recursively for each of the slots.  The default is \code{FALSE}.}
-
-\item{info}{extra information to be included in the message (useful when
-writing tests in loops).}
-
-\item{label}{object label. When \code{NULL}, computed from deparsed object.}
-}
-\description{
-Similar to \code{\link[=is_valid]{is_valid()}} except designed to work in the
-\code{\link[testthat:test_that]{testthat::test_that()}} framework.
-}
-\seealso{
-Other validity-tests: \code{\link{validity-tests}}
-}
-\concept{validity-tests}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/validity.R
+\name{expect_valid}
+\alias{expect_valid}
+\title{Expect an S4 object is valid}
+\usage{
+expect_valid(object, complete = FALSE, label = NULL)
+}
+\arguments{
+\item{object}{an S4 object to test for validity}
+
+\item{complete}{logical; if \code{TRUE}, \code{validObject} is
+      called recursively for each of the slots.  The default is \code{FALSE}.}
+
+\item{label}{Used to customise failure messages. For expert use only.}
+}
+\description{
+Similar to \code{\link[=is_valid]{is_valid()}} except designed to work in the
+\code{\link[testthat:test_that]{testthat::test_that()}} framework.
+}
+\seealso{
+Other validity-tests: 
+\code{\link{validity-tests}}
+}
+\concept{validity-tests}
diff --git a/man/extract_tests.Rd b/man/extract_tests.Rd
index 1c6ebfc..3cc5381 100644
--- a/man/extract_tests.Rd
+++ b/man/extract_tests.Rd
@@ -1,47 +1,51 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/extract_tests.R
-\name{extract_tests}
-\alias{extract_tests}
-\title{Extract tests from source}
-\usage{
-extract_tests(pkg = ".", filter = NULL,
-  verbose = getOption("verbose", FALSE), full.path = NA,
-  force = FALSE)
-}
-\arguments{
-\item{pkg}{The root directory of the package.}
-
-\item{filter}{If specified, only tests from files matching
-this regular expression are extracted.}
-
-\item{verbose}{Print message?}
-
-\item{full.path}{Include full file paths in generated files.
-TRUE, indicates full path,
-FALSE, indicated only basename, and
-NA(default) implies path relative to \code{pkg}.}
-
-\item{force}{Force test extraction even if the generated test file
-is newer than the corresponding source file.}
-}
-\description{
-Use this function to extract tests from package source files.
-In-source testing blocks are contained in blocks that are prevented
-from running when sourced by an \code{if(FALSE){...}} statement.
-It also contains a documentation tag to denote a testing block.
-}
-\details{
-The first line of the block should look similar to\preformatted{    if(FALSE){#@testing [optional information]
-    ...
-    }
-}
-}
-\examples{
-\dontrun{
-# Extract all files
-extract_tests('.')
-
-# Extract only files that start with 'Class-' or 'class-'
-extract_tests('.', filter="^[Cc]lass-.*\\\\.[Rr]$")
-}
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/extract_tests.R
+\name{extract_tests}
+\alias{extract_tests}
+\title{Extract tests from source}
+\usage{
+extract_tests(
+  pkg = ".",
+  filter = NULL,
+  verbose = getOption("verbose", FALSE),
+  full.path = NA,
+  force = FALSE
+)
+}
+\arguments{
+\item{pkg}{The root directory of the package.}
+
+\item{filter}{If specified, only tests from files matching
+this regular expression are extracted.}
+
+\item{verbose}{Print message?}
+
+\item{full.path}{Include full file paths in generated files.
+TRUE, indicates full path,
+FALSE, indicated only basename, and
+NA(default) implies path relative to \code{pkg}.}
+
+\item{force}{Force test extraction even if the generated test file
+is newer than the corresponding source file.}
+}
+\description{
+Use this function to extract tests from package source files.
+In-source testing blocks are contained in blocks that are prevented
+from running when sourced by an \code{if(FALSE){...}} statement.
+It also contains a documentation tag to denote a testing block.
+}
+\details{
+The first line of the block should look similar to\preformatted{    if(FALSE)\{#@testing [optional information]
+    ...
+    \}
+}
+}
+\examples{
+\dontrun{
+# Extract all files
+extract_tests('.')
+
+# Extract only files that start with 'Class-' or 'class-'
+extract_tests('.', filter="^[Cc]lass-.*\\\\.[Rr]$")
+}
+}
diff --git a/man/is_valid_regex.Rd b/man/is_valid_regex.Rd
index d736af6..14c7bc6 100644
--- a/man/is_valid_regex.Rd
+++ b/man/is_valid_regex.Rd
@@ -1,14 +1,14 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/util-testing.R
-\name{is_valid_regex}
-\alias{is_valid_regex}
-\title{Check if a regular expression is valid.}
-\usage{
-is_valid_regex(pattern)
-}
-\arguments{
-\item{pattern}{the regular expression pattern to test.}
-}
-\description{
-Check if a regular expression is valid.
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/util-testing.R
+\name{is_valid_regex}
+\alias{is_valid_regex}
+\title{Check if a regular expression is valid.}
+\usage{
+is_valid_regex(pattern)
+}
+\arguments{
+\item{pattern}{the regular expression pattern to test.}
+}
+\description{
+Check if a regular expression is valid.
+}
diff --git a/man/namespaces.Rd b/man/namespaces.Rd
index c5ece3c..48eb3be 100644
--- a/man/namespaces.Rd
+++ b/man/namespaces.Rd
@@ -1,83 +1,80 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/new_namespace.R
-\name{namespaces}
-\alias{namespaces}
-\alias{new_namespace_env}
-\alias{new_pkg_environment}
-\alias{register_namespace}
-\alias{unregister_namespace}
-\alias{is_namespace_registered}
-\title{Create namespace environments}
-\usage{
-new_namespace_env(name, path = file.path(tempdir()),
-  import = "methods")
-
-new_pkg_environment(name = "test package environment", ...,
-  register = FALSE)
-
-register_namespace(ns)
-
-unregister_namespace(ns)
-
-is_namespace_registered(ns)
-}
-\arguments{
-\item{name}{The name of the environment}
-
-\item{path}{An optional path.}
-
-\item{import}{Package to include in the imports.}
-
-\item{...}{Arguments passed on to \code{new_namespace_env}
-\describe{
-  \item{name}{The name of the environment}
-  \item{path}{An optional path.}
-  \item{import}{Package to include in the imports.}
-}}
-
-\item{register}{Should the package namespace be registered?}
-
-\item{ns}{a namespace environment or a character name of a namespace.}
-}
-\description{
-Create and manipulate namespace and test package environments.
-}
-\section{Functions}{
-\itemize{
-\item \code{new_namespace_env}: Create a new namespace environment
-
-\item \code{new_pkg_environment}: Create a package environment.
-All package environments are namespaces but not all
-namespaces qualify as package environments.
-
-\item \code{register_namespace}: Register a namespace
-
-\item \code{unregister_namespace}: Remove a namespace from the registry
-
-\item \code{is_namespace_registered}: Check if a namespace is registered
-}}
-
-\examples{
-ns <- new_namespace_env('my namespace')
-isNamespace(ns)
-environmentName(ns)
-packageName(ns) # not a package
-
-pkg <- new_pkg_environment("myPackage")
-isNamespace(pkg)
-environmentName(pkg)
-packageName(pkg)             # now a package
-is_namespace_registered(pkg) # but not registered
-\dontrun{
-asNamespace("myPackage")     # so this WILL NOT work.
-}
-
-register_namespace(pkg)
-is_namespace_registered(pkg) # now registered
-asNamespace("myPackage")     # so this WILL work.
-
-unregister_namespace(pkg)
-is_namespace_registered(pkg) # now unregistered
-isNamespace(pkg)             # but still a namespace
-
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/new_namespace.R
+\name{namespaces}
+\alias{namespaces}
+\alias{new_namespace_env}
+\alias{new_pkg_environment}
+\alias{register_namespace}
+\alias{unregister_namespace}
+\alias{is_namespace_registered}
+\title{Create namespace environments}
+\usage{
+new_namespace_env(name, path = file.path(tempdir()), import = "methods")
+
+new_pkg_environment(name = "test package environment", ..., register = FALSE)
+
+register_namespace(ns)
+
+unregister_namespace(ns)
+
+is_namespace_registered(ns)
+}
+\arguments{
+\item{name}{The name of the environment}
+
+\item{path}{An optional path.}
+
+\item{import}{Package to include in the imports.}
+
+\item{...}{
+  Arguments passed on to \code{\link[=new_namespace_env]{new_namespace_env}}
+  \describe{
+    \item{\code{}}{}
+  }}
+
+\item{register}{Should the package namespace be registered?}
+
+\item{ns}{a namespace environment or a character name of a namespace.}
+}
+\description{
+Create and manipulate namespace and test package environments.
+}
+\section{Functions}{
+\itemize{
+\item \code{new_namespace_env}: Create a new namespace environment
+
+\item \code{new_pkg_environment}: Create a package environment.
+All package environments are namespaces but not all
+namespaces qualify as package environments.
+
+\item \code{register_namespace}: Register a namespace
+
+\item \code{unregister_namespace}: Remove a namespace from the registry
+
+\item \code{is_namespace_registered}: Check if a namespace is registered
+}}
+
+\examples{
+ns <- new_namespace_env('my namespace')
+isNamespace(ns)
+environmentName(ns)
+packageName(ns) # not a package
+
+pkg <- new_pkg_environment("myPackage")
+isNamespace(pkg)
+environmentName(pkg)
+packageName(pkg)             # now a package
+is_namespace_registered(pkg) # but not registered
+\dontrun{
+asNamespace("myPackage")     # so this WILL NOT work.
+}
+
+register_namespace(pkg)
+is_namespace_registered(pkg) # now registered
+asNamespace("myPackage")     # so this WILL work.
+
+unregister_namespace(pkg)
+is_namespace_registered(pkg) # now unregistered
+isNamespace(pkg)             # but still a namespace
+
+}
diff --git a/man/string-tests.Rd b/man/string-tests.Rd
index 15fbae4..8e46b32 100644
--- a/man/string-tests.Rd
+++ b/man/string-tests.Rd
@@ -1,39 +1,39 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/strings.R
-\name{string-tests}
-\alias{string-tests}
-\alias{is_nonempty_string}
-\alias{is_optional_string}
-\title{Tests for strings}
-\usage{
-is_nonempty_string(x)
-
-is_optional_string(x)
-}
-\arguments{
-\item{x}{a character vector/string.}
-}
-\description{
-Tests for strings
-}
-\section{Functions}{
-\itemize{
-\item \code{is_nonempty_string}: Test that a character is both a string (character vector of length one)
-and that it is non-empty, has at least one character and is not missing.
-
-\item \code{is_optional_string}: Check for an optional string: must be a character, not missing,
-a vector of either length 0 or 1, and if provided must not be empty ("").
-}}
-
-\examples{
-# TRUE
-is_nonempty_string("hello")
-
-# All FALSE
-x <- c("hello", "world")
-is_nonempty_string(x)
-is_nonempty_string(NA_character_)
-is_nonempty_string(character(0))
-is_nonempty_string(NULL)
-is_nonempty_string(12345)
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/strings.R
+\name{string-tests}
+\alias{string-tests}
+\alias{is_nonempty_string}
+\alias{is_optional_string}
+\title{Tests for strings}
+\usage{
+is_nonempty_string(x)
+
+is_optional_string(x)
+}
+\arguments{
+\item{x}{a character vector/string.}
+}
+\description{
+Tests for strings
+}
+\section{Functions}{
+\itemize{
+\item \code{is_nonempty_string}: Test that a character is both a string (character vector of length one)
+and that it is non-empty, has at least one character and is not missing.
+
+\item \code{is_optional_string}: Check for an optional string: must be a character, not missing,
+a vector of either length 0 or 1, and if provided must not be empty ("").
+}}
+
+\examples{
+# TRUE
+is_nonempty_string("hello")
+
+# All FALSE
+x <- c("hello", "world")
+is_nonempty_string(x)
+is_nonempty_string(NA_character_)
+is_nonempty_string(character(0))
+is_nonempty_string(NULL)
+is_nonempty_string(12345)
+}
diff --git a/man/test.Rd b/man/test.Rd
index 99839ae..6fd3d5a 100644
--- a/man/test.Rd
+++ b/man/test.Rd
@@ -1,54 +1,59 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/extract_tests.R
-\name{test}
-\alias{test}
-\alias{extract_and_test_file}
-\title{Extract and run package tests}
-\usage{
-test(..., pkg = switch(nargs(), ".", ..1), filter = switch(...length(),
-  ..1, ..2))
-
-extract_and_test_file(file = rstudioapi::getSourceEditorContext()$path,
-  pkg = rstudioapi::getActiveProject())
-}
-\arguments{
-\item{...}{polymorphic arguments}
-
-\item{pkg}{The package to test.}
-
-\item{filter}{An optional filter to restrict the files to extract from and run tests for.}
-
-\item{file}{for \code{test_file} the exact file to extract and test from.}
-}
-\description{
-This function corresponds to an intentionally masks \code{\link[devtools:test]{devtools::test()}}
-from the \href{https://devtools.r-lib.org/}{\code{devtools}} package.
-This version is polymorphic depending on the number of arguments given.
-}
-\details{
-When no arguments are provided all tests are extracted and run from
-the package corresponding to the active working directory.
-In other words \code{test()} is equivalent to \code{test(pkg='.', filter=NULL)}
-
-If arguments are provided they may be named.
-If any argument is named all must be named, if not found
-the two key parameters will be taken to be
-}
-\examples{
-\dontrun{
-# Extract and run all tests for the package in the
-# current working directory.
-test()
-
-# One argument form
-# extract and test class files for the
-# package in the current working directory.
-test("^Class-")
-
-# Two argument form
-# Extract files matching "Class" in the filename
-# for the package located at "inst/textExtractionTest"
-test("inst/testExtractionTest", "Class")
-
-}
-}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/extract_tests.R
+\name{test}
+\alias{test}
+\alias{extract_and_test_file}
+\title{Extract and run package tests}
+\usage{
+test(
+  ...,
+  pkg = switch(nargs(), ".", ..1),
+  filter = switch(...length(), ..1, ..2)
+)
+
+extract_and_test_file(
+  file = rstudioapi::getSourceEditorContext()$path,
+  pkg = rstudioapi::getActiveProject()
+)
+}
+\arguments{
+\item{...}{polymorphic arguments}
+
+\item{pkg}{The package to test.}
+
+\item{filter}{An optional filter to restrict the files to extract from and run tests for.}
+
+\item{file}{for \code{test_file} the exact file to extract and test from.}
+}
+\description{
+This function corresponds to an intentionally masks \code{\link[devtools:test]{devtools::test()}}
+from the \href{https://devtools.r-lib.org/}{\code{devtools}} package.
+This version is polymorphic depending on the number of arguments given.
+}
+\details{
+When no arguments are provided all tests are extracted and run from
+the package corresponding to the active working directory.
+In other words \code{test()} is equivalent to \code{test(pkg='.', filter=NULL)}
+
+If arguments are provided they may be named.
+If any argument is named all must be named, if not found
+the two key parameters will be taken to be
+}
+\examples{
+\dontrun{
+# Extract and run all tests for the package in the
+# current working directory.
+test()
+
+# One argument form
+# extract and test class files for the
+# package in the current working directory.
+test("^Class-")
+
+# Two argument form
+# Extract files matching "Class" in the filename
+# for the package located at "inst/textExtractionTest"
+test("inst/testExtractionTest", "Class")
+
+}
+}
diff --git a/man/validity-tests.Rd b/man/validity-tests.Rd
index f892530..e01383d 100644
--- a/man/validity-tests.Rd
+++ b/man/validity-tests.Rd
@@ -1,36 +1,37 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/validity.R
-\name{validity-tests}
-\alias{validity-tests}
-\alias{is_valid}
-\alias{are_valid}
-\title{Alternate check for validity}
-\usage{
-is_valid(object, complete = FALSE)
-
-are_valid(lst, complete = FALSE)
-}
-\arguments{
-\item{object}{an S4 object to test for validity}
-
-\item{complete}{logical; if \code{TRUE}, \code{validObject} is
-      called recursively for each of the slots.  The default is \code{FALSE}.}
-
-\item{lst}{a list of S4 objects to test for validity.}
-}
-\description{
-These functions will test if an object is valid
-returning a value appropriate to use in \code{\link[assertthat:validate_that]{assertthat::validate_that()}},
-\code{\link[assertthat:assert_that]{assertthat::assert_that()}}, or \code{\link[assertthat:see_if]{assertthat::see_if()}}.
-}
-\section{Functions}{
-\itemize{
-\item \code{is_valid}: Check if an object is valid.
-
-\item \code{are_valid}: Check if each element in a list is valid.
-}}
-
-\seealso{
-Other validity-tests: \code{\link{expect_valid}}
-}
-\concept{validity-tests}
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/validity.R
+\name{validity-tests}
+\alias{validity-tests}
+\alias{is_valid}
+\alias{are_valid}
+\title{Alternate check for validity}
+\usage{
+is_valid(object, complete = FALSE)
+
+are_valid(lst, complete = FALSE)
+}
+\arguments{
+\item{object}{an S4 object to test for validity}
+
+\item{complete}{logical; if \code{TRUE}, \code{validObject} is
+      called recursively for each of the slots.  The default is \code{FALSE}.}
+
+\item{lst}{a list of S4 objects to test for validity.}
+}
+\description{
+These functions will test if an object is valid
+returning a value appropriate to use in \code{\link[assertthat:validate_that]{assertthat::validate_that()}},
+\code{\link[assertthat:assert_that]{assertthat::assert_that()}}, or \code{\link[assertthat:see_if]{assertthat::see_if()}}.
+}
+\section{Functions}{
+\itemize{
+\item \code{is_valid}: Check if an object is valid.
+
+\item \code{are_valid}: Check if each element in a list is valid.
+}}
+
+\seealso{
+Other validity-tests: 
+\code{\link{expect_valid}()}
+}
+\concept{validity-tests}
diff --git a/tests/testthat.R b/tests/testthat.R
index d8731c7..3ccee2f 100644
--- a/tests/testthat.R
+++ b/tests/testthat.R
@@ -1,5 +1,5 @@
-# This file was created by `documentation::extract_tests` on 2018-11-12 16:19:15.
-# Once present, this file will not be overwritten and changes will persist.
-# To recreate the default version of this file delete and rerun `extract_tests`.
-library(testthat)
-test_check("testextra")
+# This file was created by `documentation::extract_tests` on 2018-11-12 16:19:15.
+# Once present, this file will not be overwritten and changes will persist.
+# To recreate the default version of this file delete and rerun `extract_tests`.
+library(testthat)
+test_check("testextra")
diff --git a/tests/testthat/test-extract_tests.R b/tests/testthat/test-extract_tests.R
index cfcfe07..69e43fc 100644
--- a/tests/testthat/test-extract_tests.R
+++ b/tests/testthat/test-extract_tests.R
@@ -1,428 +1,428 @@
-#! This file was automatically produced by the testextra package.
-#! Changes will be overwritten.
-
-context('tests extracted from file `extract_tests.R`')
-#line 46 "R/extract_tests.R"
-test_that('.pkg_base', {#@testing
-    test.pkg.src <- system.file("testExtractionTest", "R", package = "testextra")
-    pkg <- normalizePath( file.path(tempdir(), "testExtractionTest")
-                        , "/", mustWork = FALSE)
-    if (dir.exists(pkg))
-        unlink(pkg, recursive = TRUE, force = TRUE)
-
-    suppress_messages(
-    package.skeleton("testExtractionTest", path=tempdir()
-                    , code_files = list.files(test.pkg.src, full=TRUE)
-                    ))
-    expect_identical(.pkg_base(pkg), pkg)
-    expect_identical(.pkg_base(file.path(pkg, "R", fsep = '/')), pkg)
-    expect_identical(.pkg_base(file.path(pkg, "R", "Class.R", fsep = '/')), pkg)
-
-    unlink(file.path(pkg, "DESCRIPTION", fsep = '/'))
-    expect_null(.pkg_base(pkg))
-
-    unlink(pkg, recursive = TRUE, force = TRUE)
-})
-#line 117 "R/extract_tests.R"
-test_that('.extract_tests_to_file Basic', {#@testing .extract_tests_to_file Basic
-{'hello_world <- function(){
-    print("hello world")
-}
-if(FALSE){#!@testthat
-    expect_output(hello_world(), "hello world")
-}
-
-f2 <- function(){stop("this does nothing")}
-if(F){#! @test
-    expect_error(f2())
-}
-if(F){#! example
-    hw()
-}
-'}-> text
-tmp.in  <- normalizePath(tempfile("src-" , fileext=".R"), '/', FALSE)
-tmp.out <- normalizePath(tempfile("test-", fileext=".R"), '/', FALSE)
-if (!dir.exists(. <- dirname(tmp.in))) dir.create(.)
-
-writeLines(text, tmp.in)
-
-x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE)
-
-expect_true ( file.exists(tmp.out))
-expect_equal( lines <- readLines(tmp.out)
-            , c( "#! This file was automatically produced by the testextra package."
-               , "#! Changes will be overwritten."
-               , ""
-               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
-               , sprintf("#line 4 \"%s\"", tmp.in)
-               , "test_that('hello_world', {#!@testthat"
-               , "    expect_output(hello_world(), \"hello world\")"
-               , "})"
-               , sprintf("#line 9 \"%s\"", tmp.in)
-               , "test_that('f2', {#! @test"
-               , "    expect_error(f2())"
-               , "})"
-               ))
-expect_equal(x, structure(c("hello_world", "f2"), test.file = tmp.out))
-unlink(tmp.out)
-
-expect_message( x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=TRUE)
-              , "* Extracting tests from file `.*`."
-              )
-expect_true (file.exists(tmp.out))
-expect_equal( lines
-            , c( "#! This file was automatically produced by the testextra package."
-               , "#! Changes will be overwritten."
-               , ""
-               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
-               , sprintf("#line 4 \"%s\"", tmp.in)
-               , "test_that('hello_world', {#!@testthat"
-               , "    expect_output(hello_world(), \"hello world\")"
-               , "})"
-               , sprintf("#line 9 \"%s\"", tmp.in)
-               , "test_that('f2', {#! @test"
-               , "    expect_error(f2())"
-               , "})"
-               ))
-expect_equal(x, structure(c("hello_world", "f2"), test.file = tmp.out))
-
-val <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE, force=FALSE)
-expect_identical(val, structure(character(0), test.file=tmp.out))
-expect_message( val <- .extract_tests_to_file(tmp.in, tmp.out, verbose=TRUE, force=FALSE)
-              , "  \\+ file `" %<<<% tmp.out %<<<% "` is newer\\.  SKIPPING\\."
-              )
-
-val <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE, force=TRUE)
-expect_equal(val, structure(c("hello_world", "f2"), test.file = tmp.out))
-
-unlink(tmp.out)
-
-
-withr::with_dir(dirname(tmp.in), {
-    if (dir.exists('tests')) unlink('tests', recursive = TRUE, force = TRUE)
-    x <- .extract_tests_to_file( file = basename(tmp.in)
-                               , file.out = NULL
-                               , NULL
-                               , verbose=FALSE)
-    file.out <- file.path('.', "test-" %<<<% basename(tmp.in), fsep='/')
-    expect_true(file.exists(file.out))
-    expect_equal( lines <- readLines(file.out)
-                , c( "#! This file was automatically produced by the testextra package."
-                   , "#! Changes will be overwritten."
-                   , ""
-                   , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
-                   , sprintf("#line 4 \"%s\"", basename(tmp.in))
-                   , "test_that('hello_world', {#!@testthat"
-                   , "    expect_output(hello_world(), \"hello world\")"
-                   , "})"
-                   , sprintf("#line 9 \"%s\"", basename(tmp.in))
-                   , "test_that('f2', {#! @test"
-                   , "    expect_error(f2())"
-                   , "})"
-                   ))
-    expect_equal(x, structure(c("hello_world", "f2")
-                     , test.file = file.out))
-    unlink(file.out)
-})
-withr::with_dir(dirname(tmp.in), {
-    if (!dir.exists('tests')) dir.create('tests') else
-    if ( dir.exists('tests/testthat')) unlink('tests/testthat', TRUE, TRUE)
-    expect_message({
-        x <- .extract_tests_to_file( file = basename(tmp.in)
-                                   , file.out = NULL
-                                   , NULL
-                                   , verbose=TRUE)
-    }, "  \\+ `test.dir` not provided. Setting to `.*`")
-    file.out <- "./tests/test-" %<<<% basename(tmp.in)
-    expect_true(file.exists(file.out))
-    expect_equal( lines <- readLines(file.out)
-                , c( "#! This file was automatically produced by the testextra package."
-                   , "#! Changes will be overwritten."
-                   , ""
-                   , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
-                   , sprintf("#line 4 \"%s\"", basename(tmp.in))
-                   , "test_that('hello_world', {#!@testthat"
-                   , "    expect_output(hello_world(), \"hello world\")"
-                   , "})"
-                   , sprintf("#line 9 \"%s\"", basename(tmp.in))
-                   , "test_that('f2', {#! @test"
-                   , "    expect_error(f2())"
-                   , "})"
-                   ))
-    expect_equal(x, structure(c("hello_world", "f2"), test.file = file.out))
-    unlink(file.out)
-    unlink("tests", force = TRUE)
-})
-withr::with_dir(dirname(tmp.in), {
-    if (!dir.exists('tests/testthat'))
-        dir.create('tests/testthat', recursive = TRUE)
-    tryCatch({
-    expect_true(file.exists(basename(tmp.in)))
-    expect_message({
-        x <- .extract_tests_to_file( file = basename(tmp.in)
-                                   , file.out = NULL
-                                   , test.dir = NULL
-                                   , verbose=TRUE)
-    }, "  \\+ Writting extracted tests to `.*`.")
-    file.out <- "./tests/testthat/test-" %<<<% basename(tmp.in)
-    expect_true(file.exists(file.out))
-    expect_equal( lines <- readLines(file.out)
-                , c( "#! This file was automatically produced by the testextra package."
-                   , "#! Changes will be overwritten."
-                   , ""
-                   , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
-                   , sprintf("#line 4 \"%s\"", basename(tmp.in))
-                   , "test_that('hello_world', {#!@testthat"
-                   , "    expect_output(hello_world(), \"hello world\")"
-                   , "})"
-                   , sprintf("#line 9 \"%s\"", basename(tmp.in))
-                   , "test_that('f2', {#! @test"
-                   , "    expect_error(f2())"
-                   , "})"
-                   ))
-    expect_equal(x, structure(c("hello_world", "f2"), test.file = file.out))
-    }, finally = unlink(file.path(tempdir(), "tests"), TRUE, TRUE))
-})
-expect_false(dir.exists(file.path(tempdir(), "tests")))
-
-unlink(tmp.in)
-})
-#line 280 "R/extract_tests.R"
-test_that('.extract_tests_to_file setClass', {#@testing .extract_tests_to_file setClass
-{'
-setClass("Test-Class")
-if(FALSE){#!@test
-    expect_true(TRUE)
-    expect_is(getClass("Test-Class"), "classRepresentation")
-}
-'}-> class.text
-
-tmp.in  <- tempfile("src-" , fileext=".R")
-tmp.out <- tempfile("test-", fileext=".R")
-
-writeLines(class.text, tmp.in)
-x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE)
-lines <- readLines(tmp.out)
-
-expect_true (file.exists(tmp.out))
-expect_equal( lines
-            , c( "#! This file was automatically produced by the testextra package."
-               , "#! Changes will be overwritten."
-               , ""
-               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
-               , sprintf("#line 3 \"%s\"", tmp.in)
-               , "test_that('setClass(\"Test-Class\", ...)', {#!@test"
-               , "    expect_true(TRUE)"
-               , "    expect_is(getClass(\"Test-Class\"), \"classRepresentation\")"
-               , "})"
-               )
-            )
-expect_equal(x, structure("setClass(\"Test-Class\", ...)", test.file = tmp.out))
-
-unlink(tmp.in)
-unlink(tmp.out)
-})
-#line 314 "R/extract_tests.R"
-test_that('.extract_tests_to_file setMethod', {#@testing .extract_tests_to_file setMethod
-'
-setMethod("show", "Test-Class", function(x){cat("hi")})
-if(FALSE){#!@test
-    expect_true(TRUE)
-}
-'-> method.text
-tmp.in  <- tempfile("src-" , fileext=".R")
-tmp.out <- tempfile("test-", fileext=".R")
-
-writeLines(method.text, tmp.in)
-x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE)
-lines <- readLines(tmp.out)
-
-expect_true (file.exists(tmp.out))
-expect_equal( lines
-            , c( "#! This file was automatically produced by the testextra package."
-               , "#! Changes will be overwritten."
-               , ""
-               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
-               , sprintf("#line 3 \"%s\"", tmp.in)
-               , "test_that('show,Test-Class-method', {#!@test"
-               , "    expect_true(TRUE)"
-               , "})"
-               )
-            )
-expect_equal(x, structure("show,Test-Class-method", test.file = tmp.out))
-
-unlink(tmp.in)
-unlink(tmp.out)
-})
-#line 345 "R/extract_tests.R"
-test_that('.extract_tests_to_file setGeneric', {#@testing .extract_tests_to_file setGeneric
-'
-setGeneric("yolo", yolo::yolo)
-if(FALSE){#!@test
-    expect_true(TRUE)
-}
-'-> generic.text
-tmp.in  <- tempfile("src-" , fileext=".R")
-tmp.out <- tempfile("test-", fileext=".R")
-
-writeLines(generic.text, tmp.in)
-x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE)
-lines <- readLines(tmp.out)
-
-expect_true (file.exists(tmp.out))
-expect_equal( lines
-            , c( "#! This file was automatically produced by the testextra package."
-               , "#! Changes will be overwritten."
-               , ""
-               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
-               , sprintf("#line 3 \"%s\"", tmp.in)
-               , "test_that('setGeneric(\"yolo\", ...)', {#!@test"
-               , "    expect_true(TRUE)"
-               , "})"
-               )
-            )
-expect_equal(x, structure("setGeneric(\"yolo\", ...)", test.file = tmp.out))
-})
-#line 373 "R/extract_tests.R"
-test_that('.extract_tests_to_file no test blocks', {#@testing .extract_tests_to_file no test blocks
-'hello_world <- function(){
-    print("hello world")
-}
-
-f2 <- function(){stop("this does nothing")}
-if(F){#! example
-    hw()
-}
-'-> text
-tmp.in  <- tempfile("src-" , fileext=".R")
-tmp.out <- tempfile("test-", fileext=".R")
-
-writeLines(text, tmp.in)
-expect_message( x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=TRUE)
-              , class = "testextra-message")
-expect_identical(x, character())
-expect_false (file.exists(tmp.out))
-})
-#line 497 "R/extract_tests.R"
-test_that('extract_tests', {#@testing
-    tmp.dir <- normalizePath(tempdir(), '/', TRUE)
-    if (!dir.exists(tmp.dir)) dir.create(tmp.dir)
-    if (dir.exists(. <- file.path(tmp.dir, "testExtractionTest")))
-        unlink(., recursive = TRUE, force = TRUE)
-    package.skeleton("testExtractionTest", path=tmp.dir, force=TRUE
-                    , code_files = list.files(system.file("testExtractionTest", "R", package='testextra'), full=TRUE)
-                    )
-    pkg <- file.path(tmp.dir, "testExtractionTest", fsep='/')
-    expect_warning( result <- extract_tests(pkg)
-                  , "testthat not found in suggests. `extract_tests` assumes a testthat infrastructure.")
-    test.dir <- file.path(tmp.dir, 'testExtractionTest', 'tests', 'testthat', fsep='/')
-    expected <- structure( list( structure(c( "setClass(\"Test-Class\", ...)"
-                                    , "show,Test-Class-method"
-                                    , "setGeneric(\"yolo\", ...)"
-                                    )
-                                  , test.file = file.path(test.dir, 'test-Class.R', fsep='/')
-                                  )
-                               , structure("hello_world"
-                                  , test.file = file.path(test.dir, 'test-function.R', fsep='/')
-                                  )
-                               )
-                         , names = file.path('R', c('Class.R', 'function.R'))
-                         )
-    test.dir <- normalizePath(file.path(pkg, "tests", "testthat"), '/', FALSE)
-    expect_identical(list.files(test.dir), c('test-Class.R', 'test-function.R'))
-
-    file <- file.path(test.dir, 'test-Class.R')
-    expect_identical( readLines(file)[c(1:5)]
-                    , c( "#! This file was automatically produced by the testextra package."
-                       , "#! Changes will be overwritten."
-                       , ""
-                       , "context('tests extracted from file `Class.R`')"
-                       , "#line 4 \"R/Class.R\""
-                       )
-                    )
-
-    expect_equal( result, expected)
-    expect_true(dir.exists(file.path(pkg, "tests", "testthat")))
-    expect_true(file.exists(file.path(pkg, "tests", "testthat", "test-Class.R")))
-    expect_true(file.exists(file.path(pkg, "tests", "testthat", "test-function.R")))
-
-    description <- as.data.frame(read.dcf(file.path(pkg, 'DESCRIPTION')))
-    description$Suggests <- collapse(c('testthat', 'testextra'), ", ")
-    write.dcf(description, file=file.path(pkg, 'DESCRIPTION'))
-
-    unlink(sapply(expected, attr, 'test.file'))
-    expect_silent(result <- extract_tests(pkg, full.path = TRUE))
-    expected <- structure( expected
-                         , names = file.path(pkg, 'R', c('Class.R', 'function.R'), fsep ="/"))
-    expect_identical(result, expected)
-
-    file <- file.path(test.dir, 'test-Class.R')
-    from <- normalizePath(file.path(pkg, "R", "Class.R"), '/', FALSE)
-    expect_identical( readLines(file)[c(1:5)]
-                    , c( "#! This file was automatically produced by the testextra package."
-                       , "#! Changes will be overwritten."
-                       , ""
-                       , "context('tests extracted from file `" %<<<% from %<<<% "`')"
-                       , "#line 4 \"" %<<<% from %<<<%"\""
-                       )
-                    )
-
-
-    unlink(sapply(expected, attr, 'test.file'))
-    expect_silent(result <- extract_tests(pkg, full.path = FALSE))
-    expected <- structure( expected
-                         , names = c('Class.R', 'function.R')
-                         )
-    expect_identical(result, expected)
-
-    file <- file.path(test.dir, 'test-Class.R')
-    from <- normalizePath(file.path(pkg, "R", "Class.R"), '/', FALSE)
-    expect_identical( readLines(file)[c(1:5)]
-                    , c( "#! This file was automatically produced by the testextra package."
-                       , "#! Changes will be overwritten."
-                       , ""
-                       , "context('tests extracted from file `" %<<<% basename(from) %<<<% "`')"
-                       , "#line 4 \"" %<<<% basename(from) %<<<%"\""
-                       )
-                    )
-
-    unlink(pkg, recursive=TRUE, force = TRUE)
-})
-#line 581 "R/extract_tests.R"
-test_that('extract_tests', {#@testing
-    pkg <- file.path(tempdir(), "testExtractionTest")
-    if (dir.exists(pkg))
-        unlink(pkg, recursive = TRUE, force = TRUE)
-    package.skeleton("testExtractionTest", path=tempdir()
-                    , code_files = list.files(system.file("testExtractionTest", "R", package='testextra'), full=TRUE)
-                    )
-    test.dir <- normalizePath(file.path(pkg, "tests", "testthat"), '/', mustWork = FALSE)
-
-    description <- as.data.frame(read.dcf(file.path(pkg, 'DESCRIPTION')))
-    description$Suggests <- collapse(c('testthat', 'testextra'), ", ")
-    write.dcf(description, file=file.path(pkg, 'DESCRIPTION'))
-
-    expect_identical(list.files(test.dir, full.names = TRUE),character())
-    result <- extract_tests(pkg, filter='Class', full.path = FALSE)
-    expect_length(result, 1)
-    expect_length(result[[1]], 3)
-    expect_equal( structure(result[[1]], test.file=NULL)
-                , c( 'setClass("Test-Class", ...)'
-                   , 'show,Test-Class-method'
-                   , 'setGeneric("yolo", ...)'
-                   )
-                )
-    expect_equal( normalizePath(attr(result[[1]], "test.file"))
-                , normalizePath(file.path(test.dir, 'test-Class.R', fsep='/'))
-                )
-
-    expect_true(dir.exists(test.dir))
-    expect_identical( list.files(test.dir, full.names = FALSE)
-                    , 'test-Class.R'
-                    )
-
-    expect_error(extract_tests(pkg, filter='bad filter', full.path = FALSE)
-                , "Filtered to no files to extract from\\.")
-
-    unlink(pkg, recursive = TRUE, force=TRUE)
-})
+#! This file was automatically produced by the testextra package.
+#! Changes will be overwritten.
+
+context('tests extracted from file `extract_tests.R`')
+#line 46 "R/extract_tests.R"
+test_that('.pkg_base', {#@testing
+    test.pkg.src <- system.file("testExtractionTest", "R", package = "testextra")
+    pkg <- normalizePath( file.path(tempdir(), "testExtractionTest")
+                        , "/", mustWork = FALSE)
+    if (dir.exists(pkg))
+        unlink(pkg, recursive = TRUE, force = TRUE)
+
+    suppress_messages(
+    package.skeleton("testExtractionTest", path=tempdir()
+                    , code_files = list.files(test.pkg.src, full=TRUE)
+                    ))
+    expect_identical(.pkg_base(pkg), pkg)
+    expect_identical(.pkg_base(file.path(pkg, "R", fsep = '/')), pkg)
+    expect_identical(.pkg_base(file.path(pkg, "R", "Class.R", fsep = '/')), pkg)
+
+    unlink(file.path(pkg, "DESCRIPTION", fsep = '/'))
+    expect_null(.pkg_base(pkg))
+
+    unlink(pkg, recursive = TRUE, force = TRUE)
+})
+#line 117 "R/extract_tests.R"
+test_that('.extract_tests_to_file Basic', {#@testing .extract_tests_to_file Basic
+{'hello_world <- function(){
+    print("hello world")
+}
+if(FALSE){#!@testthat
+    expect_output(hello_world(), "hello world")
+}
+
+f2 <- function(){stop("this does nothing")}
+if(F){#! @test
+    expect_error(f2())
+}
+if(F){#! example
+    hw()
+}
+'}-> text
+tmp.in  <- normalizePath(tempfile("src-" , fileext=".R"), '/', FALSE)
+tmp.out <- normalizePath(tempfile("test-", fileext=".R"), '/', FALSE)
+if (!dir.exists(. <- dirname(tmp.in))) dir.create(.)
+
+writeLines(text, tmp.in)
+
+x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE)
+
+expect_true ( file.exists(tmp.out))
+expect_equal( lines <- readLines(tmp.out)
+            , c( "#! This file was automatically produced by the testextra package."
+               , "#! Changes will be overwritten."
+               , ""
+               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
+               , sprintf("#line 4 \"%s\"", tmp.in)
+               , "test_that('hello_world', {#!@testthat"
+               , "    expect_output(hello_world(), \"hello world\")"
+               , "})"
+               , sprintf("#line 9 \"%s\"", tmp.in)
+               , "test_that('f2', {#! @test"
+               , "    expect_error(f2())"
+               , "})"
+               ))
+expect_equal(x, structure(c("hello_world", "f2"), test.file = tmp.out))
+unlink(tmp.out)
+
+expect_message( x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=TRUE)
+              , "* Extracting tests from file `.*`."
+              )
+expect_true (file.exists(tmp.out))
+expect_equal( lines
+            , c( "#! This file was automatically produced by the testextra package."
+               , "#! Changes will be overwritten."
+               , ""
+               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
+               , sprintf("#line 4 \"%s\"", tmp.in)
+               , "test_that('hello_world', {#!@testthat"
+               , "    expect_output(hello_world(), \"hello world\")"
+               , "})"
+               , sprintf("#line 9 \"%s\"", tmp.in)
+               , "test_that('f2', {#! @test"
+               , "    expect_error(f2())"
+               , "})"
+               ))
+expect_equal(x, structure(c("hello_world", "f2"), test.file = tmp.out))
+
+val <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE, force=FALSE)
+expect_identical(val, structure(character(0), test.file=tmp.out))
+expect_message( val <- .extract_tests_to_file(tmp.in, tmp.out, verbose=TRUE, force=FALSE)
+              , "  \\+ file `" %<<<% tmp.out %<<<% "` is newer\\.  SKIPPING\\."
+              )
+
+val <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE, force=TRUE)
+expect_equal(val, structure(c("hello_world", "f2"), test.file = tmp.out))
+
+unlink(tmp.out)
+
+
+withr::with_dir(dirname(tmp.in), {
+    if (dir.exists('tests')) unlink('tests', recursive = TRUE, force = TRUE)
+    x <- .extract_tests_to_file( file = basename(tmp.in)
+                               , file.out = NULL
+                               , NULL
+                               , verbose=FALSE)
+    file.out <- file.path('.', "test-" %<<<% basename(tmp.in), fsep='/')
+    expect_true(file.exists(file.out))
+    expect_equal( lines <- readLines(file.out)
+                , c( "#! This file was automatically produced by the testextra package."
+                   , "#! Changes will be overwritten."
+                   , ""
+                   , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
+                   , sprintf("#line 4 \"%s\"", basename(tmp.in))
+                   , "test_that('hello_world', {#!@testthat"
+                   , "    expect_output(hello_world(), \"hello world\")"
+                   , "})"
+                   , sprintf("#line 9 \"%s\"", basename(tmp.in))
+                   , "test_that('f2', {#! @test"
+                   , "    expect_error(f2())"
+                   , "})"
+                   ))
+    expect_equal(x, structure(c("hello_world", "f2")
+                     , test.file = file.out))
+    unlink(file.out)
+})
+withr::with_dir(dirname(tmp.in), {
+    if (!dir.exists('tests')) dir.create('tests') else
+    if ( dir.exists('tests/testthat')) unlink('tests/testthat', TRUE, TRUE)
+    expect_message({
+        x <- .extract_tests_to_file( file = basename(tmp.in)
+                                   , file.out = NULL
+                                   , NULL
+                                   , verbose=TRUE)
+    }, "  \\+ `test.dir` not provided. Setting to `.*`")
+    file.out <- "./tests/test-" %<<<% basename(tmp.in)
+    expect_true(file.exists(file.out))
+    expect_equal( lines <- readLines(file.out)
+                , c( "#! This file was automatically produced by the testextra package."
+                   , "#! Changes will be overwritten."
+                   , ""
+                   , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
+                   , sprintf("#line 4 \"%s\"", basename(tmp.in))
+                   , "test_that('hello_world', {#!@testthat"
+                   , "    expect_output(hello_world(), \"hello world\")"
+                   , "})"
+                   , sprintf("#line 9 \"%s\"", basename(tmp.in))
+                   , "test_that('f2', {#! @test"
+                   , "    expect_error(f2())"
+                   , "})"
+                   ))
+    expect_equal(x, structure(c("hello_world", "f2"), test.file = file.out))
+    unlink(file.out)
+    unlink("tests", force = TRUE)
+})
+withr::with_dir(dirname(tmp.in), {
+    if (!dir.exists('tests/testthat'))
+        dir.create('tests/testthat', recursive = TRUE)
+    tryCatch({
+    expect_true(file.exists(basename(tmp.in)))
+    expect_message({
+        x <- .extract_tests_to_file( file = basename(tmp.in)
+                                   , file.out = NULL
+                                   , test.dir = NULL
+                                   , verbose=TRUE)
+    }, "  \\+ Writting extracted tests to `.*`.")
+    file.out <- "./tests/testthat/test-" %<<<% basename(tmp.in)
+    expect_true(file.exists(file.out))
+    expect_equal( lines <- readLines(file.out)
+                , c( "#! This file was automatically produced by the testextra package."
+                   , "#! Changes will be overwritten."
+                   , ""
+                   , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
+                   , sprintf("#line 4 \"%s\"", basename(tmp.in))
+                   , "test_that('hello_world', {#!@testthat"
+                   , "    expect_output(hello_world(), \"hello world\")"
+                   , "})"
+                   , sprintf("#line 9 \"%s\"", basename(tmp.in))
+                   , "test_that('f2', {#! @test"
+                   , "    expect_error(f2())"
+                   , "})"
+                   ))
+    expect_equal(x, structure(c("hello_world", "f2"), test.file = file.out))
+    }, finally = unlink(file.path(tempdir(), "tests"), TRUE, TRUE))
+})
+expect_false(dir.exists(file.path(tempdir(), "tests")))
+
+unlink(tmp.in)
+})
+#line 280 "R/extract_tests.R"
+test_that('.extract_tests_to_file setClass', {#@testing .extract_tests_to_file setClass
+{'
+setClass("Test-Class")
+if(FALSE){#!@test
+    expect_true(TRUE)
+    expect_is(getClass("Test-Class"), "classRepresentation")
+}
+'}-> class.text
+
+tmp.in  <- tempfile("src-" , fileext=".R")
+tmp.out <- tempfile("test-", fileext=".R")
+
+writeLines(class.text, tmp.in)
+x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE)
+lines <- readLines(tmp.out)
+
+expect_true (file.exists(tmp.out))
+expect_equal( lines
+            , c( "#! This file was automatically produced by the testextra package."
+               , "#! Changes will be overwritten."
+               , ""
+               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
+               , sprintf("#line 3 \"%s\"", tmp.in)
+               , "test_that('setClass(\"Test-Class\", ...)', {#!@test"
+               , "    expect_true(TRUE)"
+               , "    expect_is(getClass(\"Test-Class\"), \"classRepresentation\")"
+               , "})"
+               )
+            )
+expect_equal(x, structure("setClass(\"Test-Class\", ...)", test.file = tmp.out))
+
+unlink(tmp.in)
+unlink(tmp.out)
+})
+#line 314 "R/extract_tests.R"
+test_that('.extract_tests_to_file setMethod', {#@testing .extract_tests_to_file setMethod
+'
+setMethod("show", "Test-Class", function(x){cat("hi")})
+if(FALSE){#!@test
+    expect_true(TRUE)
+}
+'-> method.text
+tmp.in  <- tempfile("src-" , fileext=".R")
+tmp.out <- tempfile("test-", fileext=".R")
+
+writeLines(method.text, tmp.in)
+x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE)
+lines <- readLines(tmp.out)
+
+expect_true (file.exists(tmp.out))
+expect_equal( lines
+            , c( "#! This file was automatically produced by the testextra package."
+               , "#! Changes will be overwritten."
+               , ""
+               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
+               , sprintf("#line 3 \"%s\"", tmp.in)
+               , "test_that('show,Test-Class-method', {#!@test"
+               , "    expect_true(TRUE)"
+               , "})"
+               )
+            )
+expect_equal(x, structure("show,Test-Class-method", test.file = tmp.out))
+
+unlink(tmp.in)
+unlink(tmp.out)
+})
+#line 345 "R/extract_tests.R"
+test_that('.extract_tests_to_file setGeneric', {#@testing .extract_tests_to_file setGeneric
+'
+setGeneric("yolo", yolo::yolo)
+if(FALSE){#!@test
+    expect_true(TRUE)
+}
+'-> generic.text
+tmp.in  <- tempfile("src-" , fileext=".R")
+tmp.out <- tempfile("test-", fileext=".R")
+
+writeLines(generic.text, tmp.in)
+x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=FALSE)
+lines <- readLines(tmp.out)
+
+expect_true (file.exists(tmp.out))
+expect_equal( lines
+            , c( "#! This file was automatically produced by the testextra package."
+               , "#! Changes will be overwritten."
+               , ""
+               , sprintf("context('tests extracted from file `%s`')", basename(tmp.in))
+               , sprintf("#line 3 \"%s\"", tmp.in)
+               , "test_that('setGeneric(\"yolo\", ...)', {#!@test"
+               , "    expect_true(TRUE)"
+               , "})"
+               )
+            )
+expect_equal(x, structure("setGeneric(\"yolo\", ...)", test.file = tmp.out))
+})
+#line 373 "R/extract_tests.R"
+test_that('.extract_tests_to_file no test blocks', {#@testing .extract_tests_to_file no test blocks
+'hello_world <- function(){
+    print("hello world")
+}
+
+f2 <- function(){stop("this does nothing")}
+if(F){#! example
+    hw()
+}
+'-> text
+tmp.in  <- tempfile("src-" , fileext=".R")
+tmp.out <- tempfile("test-", fileext=".R")
+
+writeLines(text, tmp.in)
+expect_message( x <- .extract_tests_to_file(tmp.in, tmp.out, verbose=TRUE)
+              , class = "testextra-message")
+expect_identical(x, character())
+expect_false (file.exists(tmp.out))
+})
+#line 497 "R/extract_tests.R"
+test_that('extract_tests', {#@testing
+    tmp.dir <- normalizePath(tempdir(), '/', TRUE)
+    if (!dir.exists(tmp.dir)) dir.create(tmp.dir)
+    if (dir.exists(. <- file.path(tmp.dir, "testExtractionTest")))
+        unlink(., recursive = TRUE, force = TRUE)
+    package.skeleton("testExtractionTest", path=tmp.dir, force=TRUE
+                    , code_files = list.files(system.file("testExtractionTest", "R", package='testextra'), full=TRUE)
+                    )
+    pkg <- file.path(tmp.dir, "testExtractionTest", fsep='/')
+    expect_warning( result <- extract_tests(pkg)
+                  , "testthat not found in suggests. `extract_tests` assumes a testthat infrastructure.")
+    test.dir <- file.path(tmp.dir, 'testExtractionTest', 'tests', 'testthat', fsep='/')
+    expected <- structure( list( structure(c( "setClass(\"Test-Class\", ...)"
+                                    , "show,Test-Class-method"
+                                    , "setGeneric(\"yolo\", ...)"
+                                    )
+                                  , test.file = file.path(test.dir, 'test-Class.R', fsep='/')
+                                  )
+                               , structure("hello_world"
+                                  , test.file = file.path(test.dir, 'test-function.R', fsep='/')
+                                  )
+                               )
+                         , names = file.path('R', c('Class.R', 'function.R'))
+                         )
+    test.dir <- normalizePath(file.path(pkg, "tests", "testthat"), '/', FALSE)
+    expect_identical(list.files(test.dir), c('test-Class.R', 'test-function.R'))
+
+    file <- file.path(test.dir, 'test-Class.R')
+    expect_identical( readLines(file)[c(1:5)]
+                    , c( "#! This file was automatically produced by the testextra package."
+                       , "#! Changes will be overwritten."
+                       , ""
+                       , "context('tests extracted from file `Class.R`')"
+                       , "#line 4 \"R/Class.R\""
+                       )
+                    )
+
+    expect_equal( result, expected)
+    expect_true(dir.exists(file.path(pkg, "tests", "testthat")))
+    expect_true(file.exists(file.path(pkg, "tests", "testthat", "test-Class.R")))
+    expect_true(file.exists(file.path(pkg, "tests", "testthat", "test-function.R")))
+
+    description <- as.data.frame(read.dcf(file.path(pkg, 'DESCRIPTION')))
+    description$Suggests <- collapse(c('testthat', 'testextra'), ", ")
+    write.dcf(description, file=file.path(pkg, 'DESCRIPTION'))
+
+    unlink(sapply(expected, attr, 'test.file'))
+    expect_silent(result <- extract_tests(pkg, full.path = TRUE))
+    expected <- structure( expected
+                         , names = file.path(pkg, 'R', c('Class.R', 'function.R'), fsep ="/"))
+    expect_identical(result, expected)
+
+    file <- file.path(test.dir, 'test-Class.R')
+    from <- normalizePath(file.path(pkg, "R", "Class.R"), '/', FALSE)
+    expect_identical( readLines(file)[c(1:5)]
+                    , c( "#! This file was automatically produced by the testextra package."
+                       , "#! Changes will be overwritten."
+                       , ""
+                       , "context('tests extracted from file `" %<<<% from %<<<% "`')"
+                       , "#line 4 \"" %<<<% from %<<<%"\""
+                       )
+                    )
+
+
+    unlink(sapply(expected, attr, 'test.file'))
+    expect_silent(result <- extract_tests(pkg, full.path = FALSE))
+    expected <- structure( expected
+                         , names = c('Class.R', 'function.R')
+                         )
+    expect_identical(result, expected)
+
+    file <- file.path(test.dir, 'test-Class.R')
+    from <- normalizePath(file.path(pkg, "R", "Class.R"), '/', FALSE)
+    expect_identical( readLines(file)[c(1:5)]
+                    , c( "#! This file was automatically produced by the testextra package."
+                       , "#! Changes will be overwritten."
+                       , ""
+                       , "context('tests extracted from file `" %<<<% basename(from) %<<<% "`')"
+                       , "#line 4 \"" %<<<% basename(from) %<<<%"\""
+                       )
+                    )
+
+    unlink(pkg, recursive=TRUE, force = TRUE)
+})
+#line 581 "R/extract_tests.R"
+test_that('extract_tests', {#@testing
+    pkg <- file.path(tempdir(), "testExtractionTest")
+    if (dir.exists(pkg))
+        unlink(pkg, recursive = TRUE, force = TRUE)
+    package.skeleton("testExtractionTest", path=tempdir()
+                    , code_files = list.files(system.file("testExtractionTest", "R", package='testextra'), full=TRUE)
+                    )
+    test.dir <- normalizePath(file.path(pkg, "tests", "testthat"), '/', mustWork = FALSE)
+
+    description <- as.data.frame(read.dcf(file.path(pkg, 'DESCRIPTION')))
+    description$Suggests <- collapse(c('testthat', 'testextra'), ", ")
+    write.dcf(description, file=file.path(pkg, 'DESCRIPTION'))
+
+    expect_identical(list.files(test.dir, full.names = TRUE),character())
+    result <- extract_tests(pkg, filter='Class', full.path = FALSE)
+    expect_length(result, 1)
+    expect_length(result[[1]], 3)
+    expect_equal( structure(result[[1]], test.file=NULL)
+                , c( 'setClass("Test-Class", ...)'
+                   , 'show,Test-Class-method'
+                   , 'setGeneric("yolo", ...)'
+                   )
+                )
+    expect_equal( normalizePath(attr(result[[1]], "test.file"))
+                , normalizePath(file.path(test.dir, 'test-Class.R', fsep='/'))
+                )
+
+    expect_true(dir.exists(test.dir))
+    expect_identical( list.files(test.dir, full.names = FALSE)
+                    , 'test-Class.R'
+                    )
+
+    expect_error(extract_tests(pkg, filter='bad filter', full.path = FALSE)
+                , "Filtered to no files to extract from\\.")
+
+    unlink(pkg, recursive = TRUE, force=TRUE)
+})
diff --git a/tests/testthat/test-inheritance.R b/tests/testthat/test-inheritance.R
index 4a8091b..c5e6a99 100644
--- a/tests/testthat/test-inheritance.R
+++ b/tests/testthat/test-inheritance.R
@@ -1,103 +1,103 @@
-#! This file was automatically produced by the testextra package.
-#! Changes will be overwritten.
-
-context('tests extracted from file `inheritance.R`')
-#line 41 "R/inheritance.R"
-test_that('all_inherit', {#@testing
-    l <- list( 'a', 'b', 'c'
-             , 1, 2
-             , function()"hello world"
-             )
-    expect_identical( validate_that(all_inherit(l, 'character'))
-                    , "`l` has bad elements at 4, 5, and 6" %<<%
-                      "which do not inherit from" %<<%
-                      dQuote("character") %<<<% '.')
-    expect_identical( validate_that(all_inherit(l, c('character', 'function')))
-                    , "`l` has bad elements at 4 and 5" %<<%
-                      "which do not inherit from" %<<%
-                      dQuote("character") %<<% 'or' %<<%
-                      dQuote("function") %<<<% '.')
-    expect_identical( validate_that(all_inherit(l, c('character', 'numeric')))
-                    , "`l` has bad element at 6" %<<%
-                      "which does not inherit from" %<<%
-                      dQuote("character") %<<% 'or' %<<%
-                      dQuote("numeric") %<<<% '.' %<<%
-                      "It is a" %<<% dQuote("function"))
-
-    expect_true( all_inherit(list(1L, 2L, 3L), 'integer'))
-})
-#line 71 "R/inheritance.R"
-test_that('are', {#@testing
-    lst <- list('a', 1L, TRUE)
-
-    expect_true(all(are(lst, 'ANY')))
-    expect_identical(are(lst, 'character'), c(T,F,F))
-    expect_identical(are(lst, 'integer'), c(F,T,F))
-    expect_identical(are(lst, 'numeric'), c(F,T,F))
-})
-#line 114 "R/inheritance.R"
-test_that('all_are_exactly', {#@testing
-    l <- list( 'a', 'b', 'c'
-             , 1, 2)
-    expect_identical( validate_that(all_are_exactly(l, 'character'))
-                    , "`l` has bad elements at positions 4 and 5" %<<%
-                      "which are not of class" %<<%
-                      dQuote("character") %<<<% '.')
-    expect_identical( validate_that(all_are_exactly(list(1,2), 'integer', '...'))
-                    , "... has bad elements at positions 1 and 2" %<<%
-                      "which are not of class" %<<%
-                      dQuote("integer") %<<<% '.')
-    expect_identical( validate_that(all_are_exactly(list(1L,2L), 'numeric', '...'))
-                    , "... has bad elements at positions 1 and 2" %<<%
-                      "which are not of class" %<<%
-                      dQuote("numeric") %<<<% '.')
-    expect_identical( validate_that(all_are_exactly(list(1, 2L), 'numeric', '...'))
-                    , "... has bad element at position 2" %<<%
-                      "which is not of class" %<<%
-                      dQuote("numeric") %<<<% '.')
-    expect_true(all_are_exactly(list(1L, 2L), 'integer'))
-})
-#line 165 "R/inheritance.R"
-test_that('expect_is_not', {#@testing
-    expect_is_not('a', 'numeric')
-})
-#line 183 "R/inheritance.R"
-test_that('expect_is_exactly', {#@testing
-    x <- list(1:3)
-
-    expect_identical(expect_is_exactly(x, 'list'), x)
-
-    class(x) <- c('class', 'super1', 'super2')
-
-    expect_is_exactly(x, 'class')
-
-    expect_is(x, 'super1')
-    expect_error( expect_is_exactly(x, 'super1')
-                , "`x` is a class/super1/super2; should be exactly a `super1`."
-                )
-})
-#line 207 "R/inheritance.R"
-test_that('expect_all_inherit', {#@testing
-    expect_true( expect_all_inherit(1:3, 'integer'))
-    l <- list( 'a', 'b', 'c'
-             , 1, 2
-             , function()"hello world"
-             )
-    expect_error( expect_all_inherit(l, 'character')
-                , "`l` has bad elements at 4, 5, and 6" %<<%
-                  "which do not inherit from" %<<%
-                  dQuote("character") %<<<% '.')
-    expect_error( expect_all_inherit(l, c('character', 'function'))
-                , "`l` has bad elements at 4 and 5" %<<%
-                  "which do not inherit from" %<<%
-                  dQuote("character") %<<% 'or' %<<%
-                  dQuote("function") %<<<% '.')
-    expect_error( expect_all_inherit(l, c('character', 'numeric'))
-                , "`l` has bad element at 6" %<<%
-                  "which does not inherit from" %<<%
-                  dQuote("character") %<<% 'or' %<<%
-                  dQuote("numeric") %<<<% '.' %<<%
-                  "It is a" %<<% dQuote("function"))
-
-
-})
+#! This file was automatically produced by the testextra package.
+#! Changes will be overwritten.
+
+context('tests extracted from file `inheritance.R`')
+#line 41 "R/inheritance.R"
+test_that('all_inherit', {#@testing
+    l <- list( 'a', 'b', 'c'
+             , 1, 2
+             , function()"hello world"
+             )
+    expect_identical( validate_that(all_inherit(l, 'character'))
+                    , "`l` has bad elements at 4, 5, and 6" %<<%
+                      "which do not inherit from" %<<%
+                      dQuote("character") %<<<% '.')
+    expect_identical( validate_that(all_inherit(l, c('character', 'function')))
+                    , "`l` has bad elements at 4 and 5" %<<%
+                      "which do not inherit from" %<<%
+                      dQuote("character") %<<% 'or' %<<%
+                      dQuote("function") %<<<% '.')
+    expect_identical( validate_that(all_inherit(l, c('character', 'numeric')))
+                    , "`l` has bad element at 6" %<<%
+                      "which does not inherit from" %<<%
+                      dQuote("character") %<<% 'or' %<<%
+                      dQuote("numeric") %<<<% '.' %<<%
+                      "It is a" %<<% dQuote("function"))
+
+    expect_true( all_inherit(list(1L, 2L, 3L), 'integer'))
+})
+#line 71 "R/inheritance.R"
+test_that('are', {#@testing
+    lst <- list('a', 1L, TRUE)
+
+    expect_true(all(are(lst, 'ANY')))
+    expect_identical(are(lst, 'character'), c(T,F,F))
+    expect_identical(are(lst, 'integer'), c(F,T,F))
+    expect_identical(are(lst, 'numeric'), c(F,T,F))
+})
+#line 114 "R/inheritance.R"
+test_that('all_are_exactly', {#@testing
+    l <- list( 'a', 'b', 'c'
+             , 1, 2)
+    expect_identical( validate_that(all_are_exactly(l, 'character'))
+                    , "`l` has bad elements at positions 4 and 5" %<<%
+                      "which are not of class" %<<%
+                      dQuote("character") %<<<% '.')
+    expect_identical( validate_that(all_are_exactly(list(1,2), 'integer', '...'))
+                    , "... has bad elements at positions 1 and 2" %<<%
+                      "which are not of class" %<<%
+                      dQuote("integer") %<<<% '.')
+    expect_identical( validate_that(all_are_exactly(list(1L,2L), 'numeric', '...'))
+                    , "... has bad elements at positions 1 and 2" %<<%
+                      "which are not of class" %<<%
+                      dQuote("numeric") %<<<% '.')
+    expect_identical( validate_that(all_are_exactly(list(1, 2L), 'numeric', '...'))
+                    , "... has bad element at position 2" %<<%
+                      "which is not of class" %<<%
+                      dQuote("numeric") %<<<% '.')
+    expect_true(all_are_exactly(list(1L, 2L), 'integer'))
+})
+#line 165 "R/inheritance.R"
+test_that('expect_is_not', {#@testing
+    expect_is_not('a', 'numeric')
+})
+#line 183 "R/inheritance.R"
+test_that('expect_is_exactly', {#@testing
+    x <- list(1:3)
+
+    expect_identical(expect_is_exactly(x, 'list'), x)
+
+    class(x) <- c('class', 'super1', 'super2')
+
+    expect_is_exactly(x, 'class')
+
+    expect_is(x, 'super1')
+    expect_error( expect_is_exactly(x, 'super1')
+                , "`x` is a class/super1/super2; should be exactly a `super1`."
+                )
+})
+#line 207 "R/inheritance.R"
+test_that('expect_all_inherit', {#@testing
+    expect_true( expect_all_inherit(1:3, 'integer'))
+    l <- list( 'a', 'b', 'c'
+             , 1, 2
+             , function()"hello world"
+             )
+    expect_error( expect_all_inherit(l, 'character')
+                , "`l` has bad elements at 4, 5, and 6" %<<%
+                  "which do not inherit from" %<<%
+                  dQuote("character") %<<<% '.')
+    expect_error( expect_all_inherit(l, c('character', 'function'))
+                , "`l` has bad elements at 4 and 5" %<<%
+                  "which do not inherit from" %<<%
+                  dQuote("character") %<<% 'or' %<<%
+                  dQuote("function") %<<<% '.')
+    expect_error( expect_all_inherit(l, c('character', 'numeric'))
+                , "`l` has bad element at 6" %<<%
+                  "which does not inherit from" %<<%
+                  dQuote("character") %<<% 'or' %<<%
+                  dQuote("numeric") %<<<% '.' %<<%
+                  "It is a" %<<% dQuote("function"))
+
+
+})
diff --git a/tests/testthat/test-new_namespace.R b/tests/testthat/test-new_namespace.R
index 9866abf..5a87de1 100644
--- a/tests/testthat/test-new_namespace.R
+++ b/tests/testthat/test-new_namespace.R
@@ -1,64 +1,64 @@
-#! This file was automatically produced by the testextra package.
-#! Changes will be overwritten.
-
-context('tests extracted from file `new_namespace.R`')
-#line 48 "R/new_namespace.R"
-test_that('new_namespace_env', {#@testing
-    ns <- new_namespace_env("test namespace")
-    expect_true(isNamespace(ns))
-    expect_false(isNamespaceLoaded("test namespace"))
-})
-#line 68 "R/new_namespace.R"
-test_that('new_pkg_environment', {#@testing
-    ns <- new_pkg_environment()
-    expect_true(isNamespace(ns))
-    expect_equal(getPackageName(ns), "test package environment")
-    expect_equal(environmentName(ns), "test package environment")
-    expect_false(is_namespace_registered(ns))
-
-    if (is_namespace_registered("pkg2"))
-        unregister_namespace(asNamespace("pkg2"))
-
-    ns2 <- new_pkg_environment("pkg2", register=TRUE)
-    expect_true(isNamespace(ns2))
-    expect_equal(getPackageName(ns2), "pkg2")
-    expect_equal(environmentName(ns2), "pkg2")
-    expect_true(is_namespace_registered('pkg2'))
-})
-#line 84 "R/new_namespace.R"
-test_that('Can define classes, generics and methods.', {#@testing Can define classes, generics and methods.
-    ns <- new_pkg_environment("class-test", register=TRUE)
-    expect_true(isNamespace(ns))
-    expect_equal(getPackageName(ns), "class-test")
-    expect_equal(environmentName(ns), "class-test")
-    expect_true(is_namespace_registered(ns))
-
-    cls <- setClass("my-test-class", contains='list', where=ns)
-    expect_is(cls, 'classGeneratorFunction')
-    expect_true(exists(classMetaName(cls@className), ns))
-
-    val <- setGeneric( "my_generic", function(object)stop('not implimented')
-                     , where = ns )
-    expect_identical(val, "my_generic")
-    expect_true(exists('my_generic', ns))
-
-    val <- setMethod('my_generic', 'my-test-class', function(object){
-        "horray it works"
-    }, where=ns)
-    expect_identical(val, "my_generic")
-    expect_true(exists(methodsPackageMetaName('T', "my_generic", getPackageName(ns)), ns))
-    expect_true(exists('my-test-class'
-                      , get( methodsPackageMetaName('T', "my_generic", getPackageName(ns))
-                           , ns)))
-
-    unregister_namespace(ns)
-    expect_false(is_namespace_registered(ns))
-    expect_false(unregister_namespace(ns))
-})
-#line 113 "R/new_namespace.R"
-test_that('can specify imports', {#@testing can specify imports
-    pkg <- new_pkg_environment('test-import', import=c('methods', 'testextra'))
-    expect_true(isNamespace(pkg))
-    expect_true("testextra" %in% names(pkg$.__NAMESPACE__.$imports))
-    expect_true(exists("new_pkg_environment", parent.env(pkg), inherits = TRUE))
-})
+#! This file was automatically produced by the testextra package.
+#! Changes will be overwritten.
+
+context('tests extracted from file `new_namespace.R`')
+#line 48 "R/new_namespace.R"
+test_that('new_namespace_env', {#@testing
+    ns <- new_namespace_env("test namespace")
+    expect_true(isNamespace(ns))
+    expect_false(isNamespaceLoaded("test namespace"))
+})
+#line 68 "R/new_namespace.R"
+test_that('new_pkg_environment', {#@testing
+    ns <- new_pkg_environment()
+    expect_true(isNamespace(ns))
+    expect_equal(getPackageName(ns), "test package environment")
+    expect_equal(environmentName(ns), "test package environment")
+    expect_false(is_namespace_registered(ns))
+
+    if (is_namespace_registered("pkg2"))
+        unregister_namespace(asNamespace("pkg2"))
+
+    ns2 <- new_pkg_environment("pkg2", register=TRUE)
+    expect_true(isNamespace(ns2))
+    expect_equal(getPackageName(ns2), "pkg2")
+    expect_equal(environmentName(ns2), "pkg2")
+    expect_true(is_namespace_registered('pkg2'))
+})
+#line 84 "R/new_namespace.R"
+test_that('Can define classes, generics and methods.', {#@testing Can define classes, generics and methods.
+    ns <- new_pkg_environment("class-test", register=TRUE)
+    expect_true(isNamespace(ns))
+    expect_equal(getPackageName(ns), "class-test")
+    expect_equal(environmentName(ns), "class-test")
+    expect_true(is_namespace_registered(ns))
+
+    cls <- setClass("my-test-class", contains='list', where=ns)
+    expect_is(cls, 'classGeneratorFunction')
+    expect_true(exists(classMetaName(cls@className), ns))
+
+    val <- setGeneric( "my_generic", function(object)stop('not implimented')
+                     , where = ns )
+    expect_identical(val, "my_generic")
+    expect_true(exists('my_generic', ns))
+
+    val <- setMethod('my_generic', 'my-test-class', function(object){
+        "horray it works"
+    }, where=ns)
+    expect_identical(val, "my_generic")
+    expect_true(exists(methodsPackageMetaName('T', "my_generic", getPackageName(ns)), ns))
+    expect_true(exists('my-test-class'
+                      , get( methodsPackageMetaName('T', "my_generic", getPackageName(ns))
+                           , ns)))
+
+    unregister_namespace(ns)
+    expect_false(is_namespace_registered(ns))
+    expect_false(unregister_namespace(ns))
+})
+#line 113 "R/new_namespace.R"
+test_that('can specify imports', {#@testing can specify imports
+    pkg <- new_pkg_environment('test-import', import=c('methods', 'testextra'))
+    expect_true(isNamespace(pkg))
+    expect_true("testextra" %in% names(pkg$.__NAMESPACE__.$imports))
+    expect_true(exists("new_pkg_environment", parent.env(pkg), inherits = TRUE))
+})
diff --git a/tests/testthat/test-strings.R b/tests/testthat/test-strings.R
index ba6ef87..bafc73e 100644
--- a/tests/testthat/test-strings.R
+++ b/tests/testthat/test-strings.R
@@ -1,31 +1,31 @@
-#! This file was automatically produced by the testextra package.
-#! Changes will be overwritten.
-
-context('tests extracted from file `strings.R`')
-#line 34 "R/strings.R"
-test_that('is_nonempty_string', {#@testing
-    expect_true(is_nonempty_string("hello world"))
-    expect_false(is_nonempty_string(c("hello", "world")))
-    expect_false(is_nonempty_string(character(0)))
-    expect_false(is_nonempty_string(NA_character_))
-    expect_false(is_nonempty_string(''))
-
-    expect_identical( validate_that(is_nonempty_string(character(0)))
-                    , sQuote("character(0)") %<<% .nonempty.string.msg)
-
-    bad <- NA
-    expect_identical( validate_that(is_nonempty_string(bad))
-                    , sQuote("bad") %<<%.nonempty.string.msg)
-})
-#line 62 "R/strings.R"
-test_that('is_optional_string', {#@testing
-    expect_true(is_optional_string("hello"))
-    expect_true(is_optional_string(character(0)))
-    expect_false(is_optional_string(NA_character_))
-    expect_false(is_optional_string(''))
-    expect_false(is_optional_string(letters))
-
-    bad <- NA_character_
-    expect_identical(validate_that(is_optional_string(bad))
-                    , sQuote('bad') %<<% .optional.string.msg)
-})
+#! This file was automatically produced by the testextra package.
+#! Changes will be overwritten.
+
+context('tests extracted from file `strings.R`')
+#line 34 "R/strings.R"
+test_that('is_nonempty_string', {#@testing
+    expect_true(is_nonempty_string("hello world"))
+    expect_false(is_nonempty_string(c("hello", "world")))
+    expect_false(is_nonempty_string(character(0)))
+    expect_false(is_nonempty_string(NA_character_))
+    expect_false(is_nonempty_string(''))
+
+    expect_identical( validate_that(is_nonempty_string(character(0)))
+                    , sQuote("character(0)") %<<% .nonempty.string.msg)
+
+    bad <- NA
+    expect_identical( validate_that(is_nonempty_string(bad))
+                    , sQuote("bad") %<<%.nonempty.string.msg)
+})
+#line 62 "R/strings.R"
+test_that('is_optional_string', {#@testing
+    expect_true(is_optional_string("hello"))
+    expect_true(is_optional_string(character(0)))
+    expect_false(is_optional_string(NA_character_))
+    expect_false(is_optional_string(''))
+    expect_false(is_optional_string(letters))
+
+    bad <- NA_character_
+    expect_identical(validate_that(is_optional_string(bad))
+                    , sQuote('bad') %<<% .optional.string.msg)
+})
diff --git a/tests/testthat/test-util-testing.R b/tests/testthat/test-util-testing.R
index 81fd7e5..539a37e 100644
--- a/tests/testthat/test-util-testing.R
+++ b/tests/testthat/test-util-testing.R
@@ -1,13 +1,13 @@
-#! This file was automatically produced by the testextra package.
-#! Changes will be overwritten.
-
-context('tests extracted from file `util-testing.R`')
-#line 14 "R/util-testing.R"
-test_that('is_valid_regex', {#@testing
-    expect_true(is_valid_regex("^hello world$"))
-    expect_false(is_valid_regex("^hello (world$"))
-    expect_identical( validate_that(is_valid_regex("^hello (world$"))
-                    , "invalid regular expression " %<<<%
-                      "'^hello (world$', reason 'Missing ')''"
-                    )
-})
+#! This file was automatically produced by the testextra package.
+#! Changes will be overwritten.
+
+context('tests extracted from file `util-testing.R`')
+#line 14 "R/util-testing.R"
+test_that('is_valid_regex', {#@testing
+    expect_true(is_valid_regex("^hello world$"))
+    expect_false(is_valid_regex("^hello (world$"))
+    expect_identical( validate_that(is_valid_regex("^hello (world$"))
+                    , "invalid regular expression " %<<<%
+                      "'^hello (world$', reason 'Missing ')''"
+                    )
+})

Debdiff

File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)

  • Depends: r-base-core (>= 4.2.2.20221110-2), 4.2.2.20221110-1), r-api-4.0, r-cran-assertthat, r-cran-parsetools, r-cran-pkgcond, r-cran-postlogic, r-cran-purrr, r-cran-rlang, r-cran-stringi, r-cran-testthat

More details

Full run details