Skip to content

Commit e238b00

Browse files
committed
Add basic test
1 parent 5c69b68 commit e238b00

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# multiplication works
2+
3+
Code
4+
show_all <- SlowReporter$new(min_time = 0)
5+
with_reporter(show_all, n_tests(10))
6+
Output
7+
[-.--s] : run 1
8+
[-.--s] : run 2
9+
[-.--s] : run 3
10+
[-.--s] : run 4
11+
[-.--s] : run 5
12+
[-.--s] : run 6
13+
[-.--s] : run 7
14+
[-.--s] : run 8
15+
[-.--s] : run 9
16+
[-.--s] : run 10
17+
18+
== Summary =====================================================================
19+
All tests: -.--s
20+
Slow tests: -.--s
21+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
test_that("multiplication works", {
2+
n_tests <- function(n) {
3+
for (i in 1:n) {
4+
test_that(paste0("run ", i), {
5+
suceed()
6+
})
7+
}
8+
}
9+
expect_snapshot(
10+
{
11+
show_all <- SlowReporter$new(min_time = 0)
12+
with_reporter(show_all, n_tests(10))
13+
},
14+
transform = \(x) gsub("\\d.\\d\\ds", "-.--s", x),
15+
)
16+
})

0 commit comments

Comments
 (0)