@@ -2285,21 +2285,21 @@ test(754.01, DT[,c("x1","y1","x2"):=list(x,y)], error="Supplied 3 columns to be
22852285test(754.02, DT[,c("x1","y1","x2"):=list(x,y,x)], data.table(a=letters[3:1],x=1:3,y=4:6,x1=1:3,y1=4:6,x2=1:3))
22862286# And non-recycling i.e. that a single column copy does copy the column
22872287DT = data.table(a=1:3)
2288- test(754.03, DT[,b:= a][1,a:= 4L][2,b:= 5L], data.table(a=INT(4,2,3),b=INT(1,5,3)))
2289- test(754.04, DT[,b:= a][3,b:= 6L], data.table(a=INT(4,2,3),b=INT(4,2,6)))
2290- test(754.05, DT[,a:= as.numeric(a),verbose=TRUE], output="Direct plonk.*no copy")
2288+ test(754.03, DT[, b := a][1, a := 4L][2, b := 5L], data.table(a=INT(4,2,3),b=INT(1,5,3)))
2289+ test(754.04, DT[, b := a][3, b := 6L], data.table(a=INT(4,2,3),b=INT(4,2,6)))
2290+ test(754.05, DT[, a := as.numeric(a), verbose=TRUE], output="Direct plonk.*no copy")
22912291RHS = as.integer(DT$a)
2292- test(754.06, DT[,a:=RHS,verbose=TRUE], output="RHS for item 1 has been duplicated")
2292+ test(754.06, DT[, a:= RHS, verbose=TRUE], output="RHS for item 1 has been duplicated")
22932293# Expand ALTREPS in assign.c, #5400
22942294# String conversion gets deferred
22952295## first, a regression test of R itself -- we want to make sure our own test continues to be useful & testing its intended purpose
2296- test(754.07, { a = 1:10; .Internal(inspect(a)); b = as.character(a); .Internal(inspect(b))}, output = "\\bcompact\\b.*\\bdeferred string conversion\\b")
2297- test(754.08, DT[,a:= as.character(a),verbose=TRUE], output="RHS for item 1 has been duplicated")
2296+ test(754.07, {a = 1:10; .Internal(inspect(a)); b = as.character(a); .Internal(inspect(b))}, output = "\\bcompact\\b.*\\bdeferred string conversion\\b")
2297+ test(754.08, DT[, a := as.character(a), verbose=TRUE], output="RHS for item 1 has been duplicated")
22982298# Executing the code inside of test expands the ALTREP so we repeat the code
22992299# in order to check the result after a further assignment
23002300DT = data.table(a=1:3)
2301- DT[,b:= as.character(a)]
2302- DT[, a:= 5L]
2301+ DT[, b := as.character(a)]
2302+ DT[, a := 5L]
23032303test(754.09, DT, data.table(a=5L, b=as.character(1:3)))
23042304# This function returns an ALTREP wrapper if the input is at least length 64
23052305testFun = function(x) {
0 commit comments