Skip to content

Commit 0ef8d1f

Browse files
start self.Rraw for tests of test(), test.data.table() (#7863)
1 parent 24bd450 commit 0ef8d1f

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

inst/tests/self.Rraw

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
if (exists("test.data.table", .GlobalEnv, inherits=FALSE)) {
2+
if ((tt<-compiler::enableJIT(-1))>0)
3+
cat("This is dev mode and JIT is enabled (level ", tt, ") so there will be a brief pause around the first test.\n", sep="")
4+
} else {
5+
library(data.table)
6+
7+
test = data.table:::test
8+
}
9+
10+
# multiple expected/observed warnings in test() are printed on aligned lines, #7092
11+
test(1.1, test(0, warning("a"), warning=c("a", "b"), check_value=FALSE), FALSE,
12+
output="Test 0 produced 1 warnings but expected 2\nExpected: a\n b\nObserved: a")
13+
test(1.2, test(0, {warning("a"); warning("b")}, warning="a", check_value=FALSE), FALSE,
14+
output="Test 0 produced 2 warnings but expected 1\nExpected: a\nObserved: a\n b")

inst/tests/tests.Rraw

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21692,11 +21692,7 @@ test(2370.3, yearmon(x, format="character"), c("1111M11", "2019M01", "2019M02",
2169221692
test(2370.4, yearmon("2016-08-03 01:02:03.45", format="character"), "2016M08")
2169321693
test(2370.5, yearmon(NA, format="character"), NA_character_)
2169421694

21695-
# multiple expected/observed warnings in test() are printed on aligned lines, #7092
21696-
test(2371.1, test(0, warning("a"), warning=c("a", "b"), check_value=FALSE), FALSE,
21697-
output="Test 0 produced 1 warnings but expected 2\nExpected: a\n b\nObserved: a")
21698-
test(2372.2, test(0, {warning("a"); warning("b")}, warning="a", check_value=FALSE), FALSE,
21699-
output="Test 0 produced 2 warnings but expected 1\nExpected: a\nObserved: a\n b")
21695+
# test 2371, of test() itself, moved to self.Rraw
2170021696

2170121697
# group-by on empty table works
2170221698
empty_dt = data.table()

tests/self.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
library(data.table)
2+
test.data.table(script="self.Rraw")

0 commit comments

Comments
 (0)