tests/testthat/test-pystr_isspace.R

library(pystr)
context("pystr_isspace")

test_that("it returns true if there's only spaces", {
  expect_true(pystr_isspace("   "))
})

test_that("if returns false if there's something other than a space", {
  expect_false(pystr_isspace("  a  "))
})

test_that("it returns false for an empty string", {
  expect_false(pystr_isspace(""))
})

test_that("it works with a character vector", {
  expect_equal(pystr_isspace(c("   ", "hi")), c(TRUE, FALSE))
})

Try the pystr package in your browser

Any scripts or data that you put into this service are public.

pystr documentation built on April 15, 2017, 12:30 a.m.