test-reader.R 283 B

123456789101112131415
  1. test_that("use the reader in code", {
  2. res <- llr_test('
  3. (def inception (read-string "(+ 32 10)"))
  4. inception
  5. (eval inception)
  6. ')
  7. expect_equal(res, 42, ignore_attr = TRUE)
  8. })
  9. test_that("errors if missing paren", {
  10. expect_error(
  11. llr_test("(if 1 (r/pi)")
  12. )
  13. })