@@ -18784,11 +18784,6 @@ ans = c(
1878418784 "10: 83 64 41 9 9")
1878518785# test where topn isn't necessary
1878618786test(2264.8, print(DT, show.indices=TRUE), output=ans)
18787- # printing does not fail when indices are present
18788- test(2264.9, {
18789- suppressWarnings( print(DT, show.indices=TRUE) )
18790- TRUE
18791- })
1879218787
1879318788# integer64 columns print even when bit64 isn't loaded
1879418789if (test_bit64) local({
@@ -21046,3 +21041,20 @@ test(2304.100, set(copy(DT), i=2L, j=c("L1", "L2"), value=list(list(NULL), list(
2104621041
2104721042# the integer overflow in #6729 is only noticeable with UBSan
2104821043test(2305, { fread(testDir("issue_6729.txt.bz2")); TRUE })
21044+
21045+ # Tests for print.data.table handling index columns, list classes, and unknown classes in #6806
21046+
21047+ # Test for covering classes[col_name] <- "index"
21048+ DT = data.table(A = 1:3, B = 4:6)
21049+ setindex(DT, A)
21050+ test(108, DT, data.table(t(t(DT)), key = "A"))
21051+ # Test for covering if (is.list(cls)) cls <- unlist(cls)
21052+ DT = data.table(A = 1:3, B = list(NULL, NULL, NULL))
21053+ test(109, DT, data.table(t(t(DT))))
21054+ # Test for covering if (length(cls) == 0) cls <- "unknown"
21055+ DT = data.table(A = 1:3, B = I(list()))
21056+ test(110, DT, data.table(t(t(DT))))
21057+ # Test for covering classes[col_name] <- "unknown"
21058+ DT = data.table(A = 1:3, B = 4:6, C = 7:9)
21059+ DT[, D := NULL]
21060+ test(111, DT, data.table(t(t(DT))))
0 commit comments