Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions inst/tests/testDTimport/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Package: testDTimport
Version: 0.1
Imports: data.table
2 changes: 2 additions & 0 deletions inst/tests/testDTimport/NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
importFrom(data.table, dcast)
export(test1865)
1 change: 1 addition & 0 deletions inst/tests/testDTimport/R/test1865.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test1865 = function(x) dcast(x, a ~ b, value.var = 'v')
17 changes: 15 additions & 2 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -11313,13 +11313,26 @@ DTout = data.table(
)
test(1866.6, melt(DT, measure.vars = patterns("^x", "^y", cols=names(DT))), DTout)

# test for fixed bug #5519 - dcast returned error when a package imported data.table. Fixed with commit 1263 v1.9.3
here = testDir('')
system(sprintf('cd %s && %s CMD build testDTimport',
here, file.path(R.home("bin"), "R")))
lib = tempdir()
pkg = testDir('testDTimport_0.1.tar.gz')
## force utils to supercede RStudio's version, if necessary
utils::install.packages(pkg, lib = lib, repos = NULL,
type = 'source', quiet = TRUE, verbose = FALSE)
library(testDTimport, lib.loc = lib)
DT = data.table(a = c(1, 1, 2, 2), b = c('A', 'B', 'A', 'B'), v = 1:4)
test(1867, test1865(DT), dcast(DT, a ~ b, value.var = 'v'))
detach('package:testDTimport', unload = TRUE)
remove.packages('testDTimport', lib = lib)
file.remove(pkg)

##########################

# TODO: Tests involving GForce functions needs to be run with optimisation level 1 and 2, so that both functions are tested all the time.

# TO DO: Add test for fixed bug #5519 - dcast returned error when a package imported data.table, but dint happen when "depends" on data.table. This is fixed (commit 1263 v1.9.3), but not sure how to add test.

# TO DO: test and highlight in docs that negatives are fine and fast in forderv (ref R wish #15644)
# TO DO: tests of freading classes like Date and the verbose messages there.
# TO DO: Test mid read bump of logical T/F to character, collapse back to T and F.
Expand Down