@@ -18353,52 +18353,51 @@ if (test_bit64) {
1835318353
1835418354# 5885 implement frev
1835518355d = c(NA, NaN, Inf, -Inf)
18356- test(2249.00, frev(c(FALSE, NA), copy=TRUE), c(NA, FALSE))
18357- test(2249.01, frev(c(0L, NA), copy=TRUE), c(NA, 0L))
18358- test(2249.02, frev(d, copy=TRUE), c(-Inf, Inf, NaN, NA))
18359- test(2249.03, frev(c(NA, 1, 0+2i), copy=TRUE), c(0+2i, 1, NA))
18360- test(2249.04, frev(as.raw(0:1), copy=TRUE), as.raw(1:0))
18361- test(2249.05, frev(NULL, copy=TRUE), NULL)
18362- test(2249.06, frev(character(5), copy=TRUE), character(5))
18363- test(2249.07, frev(integer(0), copy=TRUE), integer(0))
18364- test(2249.08, frev(list(1, "a"), copy=TRUE), list("a", 1))
18365- test(2249.09, frev (c(0L, NA), copy=FALSE), c(NA, 0L))
18366- test(2249.10, frev(d , copy=FALSE), c(-Inf, Inf, NaN, NA))
18367- test(2249.11, frev (c(NA, 1, 0+2i), copy=FALSE ), c(0+2i, 1, NA))
18368- test(2249.12, frev (as.raw(0:1), copy=FALSE), as.raw(1:0))
18369- test(2249.13, frev (NULL, copy=FALSE), NULL)
18370- test(2249.14, frev (character(5), copy=FALSE), character(5))
18371- test(2249.15, frev (integer(0), copy=FALSE), integer(0))
18372- test(2249.16, frev (list(1, "a"), copy=FALSE), list("a", 1))
18373- test(2249.17, frev(1:1e2, copy=TRUE), rev(1:1e2))
18356+ test(2249.00, frev(c(FALSE, NA)) , c(NA, FALSE))
18357+ test(2249.01, frev(c(0L, NA)) , c(NA, 0L))
18358+ test(2249.02, frev(d) , c(-Inf, Inf, NaN, NA))
18359+ test(2249.03, frev(c(NA, 1, 0+2i)) , c(0+2i, 1, NA))
18360+ test(2249.04, frev(as.raw(0:1)) , as.raw(1:0))
18361+ test(2249.05, frev(NULL) , NULL)
18362+ test(2249.06, frev(character(5)) , character(5))
18363+ test(2249.07, frev(integer(0)) , integer(0))
18364+ test(2249.08, frev(list(1, "a")) , list("a", 1))
18365+ test(2249.09, setrev (c(0L, NA)) , c(NA, 0L))
18366+ test(2249.10, setrev(d) , c(-Inf, Inf, NaN, NA))
18367+ test(2249.11, setrev (c(NA, 1, 0+2i)), c(0+2i, 1, NA))
18368+ test(2249.12, setrev (as.raw(0:1)) , as.raw(1:0))
18369+ test(2249.13, setrev (NULL) , NULL)
18370+ test(2249.14, setrev (character(5)) , character(5))
18371+ test(2249.15, setrev (integer(0)) , integer(0))
18372+ test(2249.16, setrev (list(1, "a")) , list("a", 1))
18373+ test(2249.17, frev(1:1e2) , rev(1:1e2))
1837418374# copy arguments
1837518375x = 1:3
18376- test(2249.21, {frev(x, copy=TRUE ); x}, 1:3)
18377- test(2249.22, {frev(x, copy=FALSE ); x}, 3:1)
18378- test(2249.23, address(x) == address(frev(x, copy=FALSE )))
18379- test(2249.24, address(x) != address(frev(x, copy=TRUE )))
18376+ test(2249.21, {frev(x); x}, 1:3)
18377+ test(2249.22, {setrev(x ); x}, 3:1)
18378+ test(2249.23, address(x) == address(setrev(x )))
18379+ test(2249.24, address(x) != address(frev(x)))
1838018380# do not alter on subsets
18381- test(2249.25, {frev (x[1:2], copy=FALSE ); x}, 1:3)
18381+ test(2249.25, {setrev (x[1:2]); x}, 1:3)
1838218382# levels
1838318383f = as.factor(letters)
18384- test(2249.31, frev(f, copy=TRUE ), rev(f))
18385- test(2249.32, frev(as.IDate(1:10), copy=TRUE ), as.IDate(10:1))
18386- test(2249.33, frev(as.IDate(1:10), copy=TRUE ), as.IDate(10:1))
18384+ test(2249.31, frev(f), rev(f))
18385+ test(2249.32, frev(as.IDate(1:10)), as.IDate(10:1))
18386+ test(2249.33, frev(as.IDate(1:10)), as.IDate(10:1))
1838718387# names
1838818388x = c(a=1L, b=2L, c=3L)
18389- test(2249.41, frev(x, copy=TRUE ), rev(x))
18390- test(2249.42, frev(x, copy=FALSE ), x)
18389+ test(2249.41, frev(x), rev(x))
18390+ test(2249.42, setrev(x ), x)
1839118391# attributes
1839218392x = structure(1:10, class = c("IDate", "Date"), att = 1L)
18393- test(2249.51, attr(frev(x, copy=TRUE ), "att"), 1L)
18394- test(2249.52, attr(frev(x, copy=FALSE ), "att"), 1L)
18393+ test(2249.51, attr(frev(x), "att"), 1L)
18394+ test(2249.52, attr(setrev(x ), "att"), 1L)
1839518395# errors
1839618396test(2249.61, frev(data.table()), error="should not be data.frame or data.table")
18397- test(2249.62, frev(1:2, copy=NA), error="must be TRUE or FALSE")
18398- test(2249.63, frev(expression(1)), error="is not supported by frev")
18399- test(2249.64, frev(matrix(1)), error="should not be matrix or array")
18397+ test(2249.62, frev(expression(1)), error="is not supported by frev")
18398+ test(2249.63, frev(matrix(1)), error="should not be matrix or array")
1840018399if (test_bit64) {
1840118400 x = as.integer64(c(1, NA, 3))
18402- test(2249.71, frev(x, copy=TRUE ), rev(x))
18403- test(2249.72, frev(x, copy=FALSE ), x)
18401+ test(2249.71, frev(x), rev(x))
18402+ test(2249.72, setrev(x ), x)
1840418403}
0 commit comments