tests/testthat/test-function-hsStringToDouble.R

test_that("hsStringToDouble() works", {
  
  expect_identical(hsStringToDouble("1.1"), 1.1)
  expect_warning(hsStringToDouble("1,1"))
  expect_identical(hsStringToDouble("1,1", dec = ","), 1.1)
  expect_error(hsStringToDouble("1.1.1"))
  
  expect_error(hsStringToDouble("1.1", dec = "*"))
  
  expect_warning(hsStringToDouble("1.1", dec = ","))
})
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.