tests/testthat/test-06-encoding.R

# Unit tests using package testthat
#
# Author: Andrie
#------------------------------------------------------------------------------



test_that("encoding functions work as expected", {
  expect_equal(encToInt("\\xfa"), c(92, 120, 102, 97))
  # expect_equal(intToEnc(8212), "—")
  expect_equal(intToEnc(encToInt("\\xfa")), "\\xfa")
  expect_equal(encToInt(intToEnc(250)), 250)

  #      print(encToInt(intToEnc(8212)))
  #      print(intToEnc(encToInt("\\xfa")))
})
andrie/surveydata documentation built on March 13, 2023, 2 a.m.