tests/testthat/test-pystr_lstrip.R

library(pystr)
context("pystr_lstrip")

test_that("it strips spaces by default", {
  expect_equal(pystr_lstrip("  spacious  "), "spacious  ")
})

test_that("it strips characters until it encounters one not in chars", {
  expect_equal(pystr_lstrip("www.example.com", "w."), "example.com")
})

test_that("it works with a character vector", {
  expect_equal(pystr_lstrip(c("  spacious  ", "  hi  ")), c("spacious  ", "hi  "))
})

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.