@@ -22,26 +22,27 @@ The easiest way to install this package is via the associated
22
22
As shown there, simply enable the universe with
23
23
24
24
``` r
25
- options(repos = c(
25
+ options (repos = c (
26
26
ropenscireviewtools = " https://ropensci-review-tools.r-universe.dev" ,
27
- CRAN = " https://cloud.r-project.org" ))
27
+ CRAN = " https://cloud.r-project.org"
28
+ ))
28
29
```
29
30
30
31
And then install the usual way with,
31
32
32
33
``` r
33
- install.packages(" autotest" )
34
+ install.packages (" autotest" )
34
35
```
35
36
36
37
Alternatively, the package can be installed by running one of the
37
38
following lines:
38
39
39
40
``` r
40
41
# install.packages("remotes")
41
- remotes :: install_git(" https://git.sr.ht/~mpadge/autotest" )
42
- remotes :: install_bitbucket(" mpadge/autotest" )
43
- remotes :: install_gitlab(" mpadge/autotest" )
44
- remotes :: install_github(" ropensci-review-tools/autotest" )
42
+ remotes :: install_git (" https://git.sr.ht/~mpadge/autotest" )
43
+ remotes :: install_bitbucket (" mpadge/autotest" )
44
+ remotes :: install_gitlab (" mpadge/autotest" )
45
+ remotes :: install_github (" ropensci-review-tools/autotest" )
45
46
```
46
47
47
48
The package can then be loaded the usual way:
@@ -86,19 +87,19 @@ implemented.
86
87
``` r
87
88
autotest_types ()
88
89
# > # A tibble: 27 × 8
89
- # > type test_name fn_name parameter parameter_type operation content test
90
- # > <chr> <chr> <chr> <chr> <chr> <chr> <chr> <lgl>
91
- # > 1 dummy rect_as_o… <NA> <NA> rectangular Convert on … "check f … TRUE
92
- # > 2 dummy rect_comp … <NA> <NA> rectangular Convert on … "expect … TRUE
93
- # > 3 dummy rect_comp … <NA> <NA> rectangular Convert on … "expect … TRUE
94
- # > 4 dummy rect_comp … <NA> <NA> rectangular Convert on … "expect … TRUE
95
- # > 5 dummy extend_re … <NA> <NA> rectangular Extend exi … "(Should … TRUE
96
- # > 6 dummy replace_r … <NA> <NA> rectangular Replace cl … "(Should … TRUE
97
- # > 7 dummy vector_to … <NA> <NA> vector Convert ve … "(Should … TRUE
98
- # > 8 dummy vector_cu … <NA> <NA> vector Custom cla … "(Should … TRUE
99
- # > 9 dummy double_is… <NA> <NA> numeric Check whet … "int par … TRUE
100
- # > 10 dummy trivial_n… <NA> <NA> numeric Add trivia … "(Should … TRUE
101
- # > # … with 17 more rows
90
+ # > type test_name fn_name parameter parameter_type operation content test
91
+ # > <chr> <chr> <chr> <chr> <chr> <chr> <chr> <lgl>
92
+ # > 1 dummy rect_as_other <NA> <NA> rectangular Convert … "check… TRUE
93
+ # > 2 dummy rect_compare_ … <NA> <NA> rectangular Convert … "expec … TRUE
94
+ # > 3 dummy rect_compare_ … <NA> <NA> rectangular Convert … "expec … TRUE
95
+ # > 4 dummy rect_compare_ … <NA> <NA> rectangular Convert … "expec … TRUE
96
+ # > 5 dummy extend_rect_c … <NA> <NA> rectangular Extend e … "(Shou … TRUE
97
+ # > 6 dummy replace_rect_ … <NA> <NA> rectangular Replace … "(Shou … TRUE
98
+ # > 7 dummy vector_to_lis … <NA> <NA> vector Convert … "(Shou … TRUE
99
+ # > 8 dummy vector_custom … <NA> <NA> vector Custom c … "(Shou … TRUE
100
+ # > 9 dummy double_is_int <NA> <NA> numeric Check wh … "int p … TRUE
101
+ # > 10 dummy trivial_noise <NA> <NA> numeric Add triv … "(Shou … TRUE
102
+ # > # ℹ 17 more rows
102
103
```
103
104
104
105
That functions returns a [ ` tibble ` ] ( https://tibble.tidyverse.org )
@@ -134,28 +135,29 @@ x <- autotest_package (package = "stats", functions = "var", test = FALSE)
134
135
# > ✔ [5 / 6]: cov
135
136
# > ✔ [6 / 6]: cor
136
137
print (x )
137
- # > # A tibble: 185 × 9
138
- # > type test_name fn_name parameter parameter_type operation content test
139
- # > <chr> <chr> <chr> <chr> <chr> <chr> <chr> <lgl>
140
- # > 1 warning par_is_de… var use <NA> Check tha… Example… TRUE
141
- # > 2 warning par_is_de… cov y <NA> Check tha… Example… TRUE
142
- # > 3 dummy trivial_n… var x numeric Add trivi… (Should… TRUE
143
- # > 4 dummy vector_cu… var x vector Custom cl… (Should… TRUE
144
- # > 5 dummy vector_to… var x vector Convert v… (Should… TRUE
145
- # > 6 dummy negate_lo… var na.rm single logical Negate de… (Functi… TRUE
146
- # > 7 dummy subst_int… var na.rm single logical Substitut… (Functi… TRUE
147
- # > 8 dummy subst_cha… var na.rm single logical Substitut… should … TRUE
148
- # > 9 dummy single_pa… var na.rm single logical Length 2 … Should … TRUE
149
- # > 10 dummy return_su… var (return … (return objec… Check tha… <NA> TRUE
150
- # > # … with 175 more rows, and 1 more variable: yaml_hash <chr>
138
+ # > # A tibble: 170 × 9
139
+ # > type test_name fn_name parameter parameter_type operation content test
140
+ # > <chr> <chr> <chr> <chr> <chr> <chr> <chr> <lgl>
141
+ # > 1 warning par_is_demo… var use <NA> Check th… Exampl… TRUE
142
+ # > 2 warning par_is_demo… cov y <NA> Check th… Exampl… TRUE
143
+ # > 3 dummy trivial_noi… var x numeric Add triv… (Shoul… TRUE
144
+ # > 4 dummy vector_cust… var x vector Custom c… (Shoul… TRUE
145
+ # > 5 dummy vector_to_l… var x vector Convert … (Shoul… TRUE
146
+ # > 6 dummy negate_logi… var na.rm single logical Negate d… (Funct… TRUE
147
+ # > 7 dummy subst_int_f… var na.rm single logical Substitu… (Funct… TRUE
148
+ # > 8 dummy subst_char_… var na.rm single logical Substitu… should… TRUE
149
+ # > 9 dummy single_par_… var na.rm single logical Length 2… Should… TRUE
150
+ # > 10 dummy return_succ… var (return … (return objec… Check th… <NA> TRUE
151
+ # > # ℹ 160 more rows
152
+ # > # ℹ 1 more variable: yaml_hash <chr>
151
153
```
152
154
153
155
Testing the ` var ` function also tests ` cor ` and ` cov ` , because these are
154
156
all documented within a single ` .Rd ` help file. Typing ` ?var ` shows that
155
157
the help topic is ` cor ` , and that the examples include the three
156
- functions, ` var ` , ` cor ` , and ` cov ` . That result details the 185 tests
158
+ functions, ` var ` , ` cor ` , and ` cov ` . That result details the 170 tests
157
159
which would be applied to the ` var ` function from the ` stats ` package.
158
- These 185 tests yield the following results when actually applied:
160
+ These 170 tests yield the following results when actually applied:
159
161
160
162
``` r
161
163
y <- autotest_package (package = " stats" , functions = " var" , test = TRUE )
@@ -168,32 +170,34 @@ y <- autotest_package (package = "stats", functions = "var", test = TRUE)
168
170
# > ✔ [5 / 6]: cov
169
171
# > ✔ [6 / 6]: cor
170
172
print (y )
171
- # > # A tibble: 23 × 9
173
+ # > # A tibble: 25 × 9
172
174
# > type test_name fn_name parameter parameter_type operation content test
173
175
# > <chr> <chr> <chr> <chr> <chr> <chr> <chr> <lgl>
174
176
# > 1 warning par_is_d… var use <NA> Check th… "Examp… TRUE
175
177
# > 2 warning par_is_d… cov y <NA> Check th… "Examp… TRUE
176
178
# > 3 diagnostic vector_t… var x vector Convert … "Funct… TRUE
177
- # > 4 diagnostic vector_t… var x vector Convert … "Funct… TRUE
178
- # > 5 diagnostic vector_t… var y vector Convert … "Funct… TRUE
179
- # > 6 diagnostic single_c… cor use single charac… upper-ca… "is ca… TRUE
180
- # > 7 diagnostic single_c… cor method single charac… upper-ca… "is ca… TRUE
181
- # > 8 diagnostic vector_c… cor x vector Custom c… "Funct… TRUE
182
- # > 9 diagnostic single_c… cor method single charac… upper-ca… "is ca… TRUE
183
- # > 10 diagnostic single_c… cor use single charac… upper-ca… "is ca… TRUE
184
- # > # … with 13 more rows, and 1 more variable: yaml_hash <chr>
179
+ # > 4 diagnostic subst_in… var na.rm single logical Substitu… "(Func… TRUE
180
+ # > 5 diagnostic vector_t… var x vector Convert … "Funct… TRUE
181
+ # > 6 diagnostic vector_t… var y vector Convert … "Funct… TRUE
182
+ # > 7 diagnostic single_c… cor use single charac… upper-ca… "is ca… TRUE
183
+ # > 8 diagnostic single_c… cor method single charac… upper-ca… "is ca… TRUE
184
+ # > 9 diagnostic vector_c… cor x vector Custom c… "Funct… TRUE
185
+ # > 10 diagnostic vector_c… cor x vector Custom c… "Funct… TRUE
186
+ # > # ℹ 15 more rows
187
+ # > # ℹ 1 more variable: yaml_hash <chr>
185
188
```
186
189
187
- And only 23 of the original 185 tests produced unexpected behaviour.
188
- There were in fact only 4 kinds of tests which produced these 23
190
+ And only 25 of the original 170 tests produced unexpected behaviour.
191
+ There were in fact only 5 kinds of tests which produced these 25
189
192
results:
190
193
191
194
``` r
192
195
unique (y $ operation )
193
- # > [1] "Check that parameter usage is demonstrated"
194
- # > [2] "Convert vector input to list-columns"
195
- # > [3] "upper-case character parameter"
196
- # > [4] "Custom class definitions for vector input"
196
+ # > [1] "Check that parameter usage is demonstrated"
197
+ # > [2] "Convert vector input to list-columns"
198
+ # > [3] "Substitute integer values for logical parameter"
199
+ # > [4] "upper-case character parameter"
200
+ # > [5] "Custom class definitions for vector input"
197
201
```
198
202
199
203
One of these involves conversion of a vector to a list-column
@@ -207,8 +211,10 @@ switched off.
207
211
208
212
``` r
209
213
types <- autotest_types (notest = " vector_to_list_col" )
210
- y <- autotest_package (package = " stats" , functions = " var" ,
211
- test = TRUE , test_data = types )
214
+ y <- autotest_package (
215
+ package = " stats" , functions = " var" ,
216
+ test = TRUE , test_data = types
217
+ )
212
218
# > ── autotesting stats ──
213
219
# >
214
220
# > ✔ [1 / 6]: var
@@ -218,20 +224,21 @@ y <- autotest_package (package = "stats", functions = "var",
218
224
# > ✔ [5 / 6]: cov
219
225
# > ✔ [6 / 6]: cor
220
226
print (y )
221
- # > # A tibble: 28 × 9
227
+ # > # A tibble: 22 × 9
222
228
# > type test_name fn_name parameter parameter_type operation content test
223
229
# > <chr> <chr> <chr> <chr> <chr> <chr> <chr> <lgl>
224
230
# > 1 warning par_is_d… var use <NA> Check th… Exampl… TRUE
225
231
# > 2 warning par_is_d… cov y <NA> Check th… Exampl… TRUE
226
- # > 3 diagnostic single_c… cor use single charac… upper-ca… is cas… TRUE
227
- # > 4 diagnostic single_c… cor method single charac… upper-ca… is cas… TRUE
228
- # > 5 diagnostic vector_c… cor x vector Custom c… Functi… TRUE
229
- # > 6 diagnostic single_c… cor method single charac… upper-ca… is cas… TRUE
230
- # > 7 diagnostic single_c… cor use single charac… upper-ca… is cas… TRUE
231
- # > 8 diagnostic single_c… cor use single charac… upper-ca… is cas… TRUE
232
- # > 9 diagnostic single_c… cor method single charac… upper-ca… is cas… TRUE
233
- # > 10 diagnostic vector_c… cov x vector Custom c… Functi… TRUE
234
- # > # … with 18 more rows, and 1 more variable: yaml_hash <chr>
232
+ # > 3 diagnostic subst_in… var na.rm single logical Substitu… (Funct… TRUE
233
+ # > 4 diagnostic single_c… cor use single charac… upper-ca… is cas… TRUE
234
+ # > 5 diagnostic single_c… cor method single charac… upper-ca… is cas… TRUE
235
+ # > 6 diagnostic vector_c… cor x vector Custom c… Functi… TRUE
236
+ # > 7 diagnostic vector_c… cor x vector Custom c… Functi… TRUE
237
+ # > 8 diagnostic single_c… cor method single charac… upper-ca… is cas… TRUE
238
+ # > 9 diagnostic single_c… cor use single charac… upper-ca… is cas… TRUE
239
+ # > 10 diagnostic single_c… cor use single charac… upper-ca… is cas… TRUE
240
+ # > # ℹ 12 more rows
241
+ # > # ℹ 1 more variable: yaml_hash <chr>
235
242
```
236
243
237
244
Those tests are still returned from ` autotest_package() ` , but with
@@ -266,17 +273,19 @@ project, you agree to abide by its terms.
266
273
267
274
## Contributors
268
275
269
-
270
276
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
271
277
<!-- prettier-ignore-start -->
272
278
<!-- markdownlint-disable -->
273
279
274
- All contributions to this project are gratefully acknowledged using the [ ` allcontributors ` package] ( https://github.com/ropenscilabs/allcontributors ) following the [ all-contributors] ( https://allcontributors.org ) specification. Contributions of any kind are welcome!
280
+ All contributions to this project are gratefully acknowledged using the
281
+ [ ` allcontributors `
282
+ package] ( https://github.com/ropenscilabs/allcontributors ) following the
283
+ [ all-contributors] ( https://allcontributors.org ) specification.
284
+ Contributions of any kind are welcome!
275
285
276
286
### Code
277
287
278
288
<table >
279
-
280
289
<tr >
281
290
<td align =" center " >
282
291
<a href =" https://github.com/mpadge " >
@@ -303,14 +312,11 @@ All contributions to this project are gratefully acknowledged using the [`allcon
303
312
<a href =" https://github.com/ropensci-review-tools/autotest/commits?author=simpar1471 " >simpar1471</a >
304
313
</td >
305
314
</tr >
306
-
307
315
</table >
308
316
309
-
310
317
### Issue Authors
311
318
312
319
<table >
313
-
314
320
<tr >
315
321
<td align =" center " >
316
322
<a href =" https://github.com/noamross " >
@@ -355,8 +361,6 @@ All contributions to this project are gratefully acknowledged using the [`allcon
355
361
<a href =" https://github.com/ropensci-review-tools/autotest/issues?q=is%3Aissue+author%3Astatnmap " >statnmap</a >
356
362
</td >
357
363
</tr >
358
-
359
-
360
364
<tr >
361
365
<td align =" center " >
362
366
<a href =" https://github.com/vgherard " >
@@ -389,14 +393,11 @@ All contributions to this project are gratefully acknowledged using the [`allcon
389
393
<a href =" https://github.com/ropensci-review-tools/autotest/issues?q=is%3Aissue+author%3Agilbertocamara " >gilbertocamara</a >
390
394
</td >
391
395
</tr >
392
-
393
396
</table >
394
397
395
-
396
398
### Issue Contributors
397
399
398
400
<table >
399
-
400
401
<tr >
401
402
<td align =" center " >
402
403
<a href =" https://github.com/schneiderpy " >
@@ -405,9 +406,7 @@ All contributions to this project are gratefully acknowledged using the [`allcon
405
406
<a href =" https://github.com/ropensci-review-tools/autotest/issues?q=is%3Aissue+commenter%3Aschneiderpy " >schneiderpy</a >
406
407
</td >
407
408
</tr >
408
-
409
409
</table >
410
-
411
410
<!-- markdownlint-enable -->
412
411
<!-- prettier-ignore-end -->
413
412
<!-- ALL-CONTRIBUTORS-LIST:END -->
0 commit comments