The R Project SVN R

Rev

Rev 66712 | Rev 79774 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 66712 Rev 66732
Line 171... Line 171...
171
x <- c(NA, "  abc", "a b c    ", "a  b c")
171
x <- c(NA, "  abc", "a b c    ", "a  b c")
172
(y <- gsub("\\s{2,}", " ", x))
172
(y <- gsub("\\s{2,}", " ", x))
173
stopifnot(y[-1] == c(" abc", "a b c ", "a b c"))
173
stopifnot(y[-1] == c(" abc", "a b c ", "a b c"))
174
x <- c("\ue4", "  abc", "a b c    ", "a  b c")
174
x <- c("\ue4", "  abc", "a b c    ", "a  b c")
175
(y <- gsub("\\s{2,}", " ", x))
175
(y <- gsub("\\s{2,}", " ", x))
176
# This test still fails after fixing example from PR#16009
-
 
177
# stopifnot(y == c(x[1], " abc", "a b c ", "a b c"))
176
stopifnot(y == c(x[1], " abc", "a b c ", "a b c"))
178
## results were c(x[1], " ", " ", " ") in both cases in R 3.1.1
177
## results were c(x[1], " ", " ", " ") in both cases in R 3.1.1