tests/testthat/test-pad-left.R

context("left-padding")


test_that("left padding works", {
  expect_equal(pad_left(1, 3), "001")
  expect_equal(pad_left(c(1, 10, 100), 3), c("001", "010", "100" ))
  expect_equal(pad_left(c(1, 10, 1000), 3), c("001", "010", "1000" ))
  expect_equal(pad_left(c(1, 10), 4, "Z"), c("ZZZ1", "ZZ10"))
})

Try the PKPDmisc package in your browser

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

PKPDmisc documentation built on April 14, 2020, 5:49 p.m.