Skip to content

Commit eea8cff

Browse files
committed
tests
1 parent 80ec759 commit eea8cff

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

inst/tests/tests.Rraw

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21168,36 +21168,31 @@ test(2317.7, DT1[DF2, on='a', e := i.e]$e, 5)
2116821168
test(2317.8, DT1[DF2, on='a', e2 := x.a + i.e]$e2, 6)
2116921169
test(2317.9, DT1[DF2, on='a', .(e = x.a + i.e)]$e, 6)
2117021170

21171-
# frank() should not strip names from named vector input
21171+
# frank() do not strip names from named vector input
2117221172
x = c(a = "a", b = "b", c = "a")
2117321173
test(2318.01, { frank(x); names(x) }, c("a", "b", "c"))
21174-
21175-
# frank() should not modify names inside a list of named vectors
21174+
# frank() do not modify names inside a list of named vectors
2117621175
ls = list(a = c(a = 1, b = 2), b = c(a = 2, b = 3))
2117721176
frank(ls)
2117821177
test(2318.02, names(ls[[1]]), c("a", "b"))
2117921178
test(2318.03, names(ls[[2]]), c("a", "b"))
21180-
21181-
# frank() should not mutate original list (deep equality)
21179+
# frank() do not mutate original list (deep equality)
2118221180
ls = list(a = c(a = 10, b = 20), b = c(a = 30, b = 40))
2118321181
original_ls = list(a = c(a = 10, b = 20), b = c(a = 30, b = 40))
2118421182
frank(ls)
2118521183
test(2318.04, identical(ls, original_ls), TRUE)
21186-
21187-
# frank() should not mutate list of unnamed vectors (control)
21184+
# frank() do not mutate list of unnamed vectors (control)
2118821185
ls = list(a = c(1, 2), b = c(2, 3))
2118921186
original_ls = list(a = c(1, 2), b = c(2, 3))
2119021187
frank(ls)
2119121188
test(2318.05, identical(ls, original_ls), TRUE)
21192-
21193-
# frank() should return correct ranks on data.table column without side effect
21189+
# frank() returns correct ranks on data.table column without side effect
2119421190
DT = data.table(x = c(3, 2, 1, 3))
2119521191
original_x = DT$x
2119621192
ranks = frank(DT$x)
2119721193
test(2318.06, ranks, c(3.5, 2, 1, 3.5))
2119821194
test(2318.07, identical(DT$x, original_x), TRUE)
21199-
21200-
# frank() should preserve names on factors
21195+
# frank() preserve names on factors
2120121196
x = factor(c("low", "medium", "high"), levels = c("low", "medium", "high"))
2120221197
names(x) = c("a", "b", "c")
2120321198
frank(x)

0 commit comments

Comments
 (0)