Skip to content

Commit 488b873

Browse files
committed
added test
1 parent c13642f commit 488b873

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

inst/tests/tests.Rraw

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21583,16 +21583,17 @@ DT = as.data.table(iris)
2158321583
test(2368.1, names(setnames(copy(DT), "Petal.Length", "Sepal.Length")),
2158421584
c("Sepal.Length", "Sepal.Width", "Sepal.Length", "Petal.Width", "Species"),
2158521585
options = list(datatable.unique.names = "off"))
21586-
2158721586
test(2368.2, names(setnames(copy(DT), "Petal.Length", "Sepal.Length")),
2158821587
c("Sepal.Length", "Sepal.Width", "Sepal.Length", "Petal.Width", "Species"),
2158921588
warning = "Duplicate column names created",
2159021589
options = list(datatable.unique.names = "warn"))
21591-
2159221590
test(2368.3, setnames(copy(DT), "Petal.Length", "Sepal.Length"),
2159321591
error = "Duplicate column names created",
2159421592
options = list(datatable.unique.names = "error"))
21595-
2159621593
test(2368.4, names(setnames(copy(DT), "Petal.Length", "Sepal.Length")),
2159721594
c("Sepal.Length", "Sepal.Width", "Sepal.Length.1", "Petal.Width", "Species"),
2159821595
options = list(datatable.unique.names = "rename"))
21596+
test(2368.5, names(setnames(copy(DT), "Petal.Length", "Sepal.Length")),
21597+
c("Sepal.Length", "Sepal.Width", "Sepal.Length", "Petal.Width", "Species"),
21598+
warning = "Invalid value for 'datatable.unique.names'",
21599+
options = list(datatable.unique.names = "invalid_option_name"))

0 commit comments

Comments
 (0)