Skip to content

Commit

Permalink
Add unit tests for invalid glue input (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
lewinfox committed Feb 17, 2024
1 parent f4c8d37 commit 8922238
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/testthat/test-icecream.R
Expand Up @@ -87,3 +87,12 @@ test_that("source file is correctly identified", {
source(temp, keep.source = TRUE)
expect_message(f(), regexp = "my_name_is_inigo_montoya")
})

test_that("invalid glue input is handled cleanly", {
expect_message(ic("{"), regexp = "\\{")
expect_message(ic("{}"), regexp = "\\{\\}")
})

test_that("JSON input is handled cleanly", {
expect_message(ic("{'a': 1}"), regexp = "\\{'a': 1\\}")
})

0 comments on commit 8922238

Please sign in to comment.