context("assign and get")

test_that("strings are preserved", {
  assign_and_get <- function(x) {
    py.assign("_test_var", x)

  expect_equal(assign_and_get("'"), "'")
  expect_equal(assign_and_get("\\"), "\\")
  expect_equal(assign_and_get("áéíóú"), "áéíóú")
  expect_equal(assign_and_get("'áéíóú\\'"), "'áéíóú\\'")
  expect_equal(assign_and_get(NULL), NULL)
  expect_equal(assign_and_get(list(a = NULL)), list(a = NULL))

Try the SnakeCharmR package in your browser

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

SnakeCharmR documentation built on May 2, 2019, 6:21 a.m.