Added unit tests for isspace

This commit is contained in:
Waldir Leoncio 2020-07-28 10:38:28 +02:00
parent d152ce624d
commit d5637fe428

View file

@ -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))
})