Added unit tests for isspace
This commit is contained in:
parent
d152ce624d
commit
d5637fe428
1 changed files with 7 additions and 0 deletions
|
|
@ -194,4 +194,11 @@ test_that("fix works as expected", {
|
|||
X <- matrix(c(-1.9, -3.4, 1.6, 2.5, -4.5, 4.5), 3, byrow=TRUE)
|
||||
Y <- matrix(c(-1, -3, 1, 2, -4, 4), 3, byrow=TRUE)
|
||||
expect_identical(fix(X), Y)
|
||||
})
|
||||
|
||||
test_that("isspace works as expected", {
|
||||
chr <- '123 Main St.'
|
||||
X <- '\t a b\tcde f'
|
||||
expect_identical(isspace(chr), c(0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0))
|
||||
expect_identical(isspace(X), c(1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0))
|
||||
})
|
||||
Loading…
Add table
Reference in a new issue