Skip to content

Commit

Permalink
Add back all tests for #370
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Aug 18, 2022
1 parent fc122e0 commit 8d51628
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
20 changes: 20 additions & 0 deletions tests/testthat/_snaps/glue.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,33 @@
Message
test_1: all good
test_2: not #good
Code
cli::cli_dl(c(test_3 = "no' good either"))
Message
test_3: no' good either
Code
cli::cli_dl(c(test_4 = "no\" good also"))
Message
test_4: no" good also
Code
cli::cli_text("{.url https://example.com/#section}")
Message
<https://example.com/#section>
Code
cli::cli_alert_success("Qapla'")
Message
v Qapla'

# quotes, etc. within expressions are still OK

Code
cli::cli_text("{.url URL} {x <- 'foo'; nchar(x)}")
Message
<URL> 3
Code
cli::cli_text("{.url URL} {x <- \"foo\"; nchar(x)}")
Message
<URL> 3
Code
cli::cli_text("{.url URL} {1 + 1 # + 1} {1 + 1}")
Message
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-glue.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ test_that("glue quotes and comments", {
"test_2" = "not #good"
)
)
# cli::cli_dl(c("test_3" = "no' good either"))
# cli::cli_dl(c("test_4" = "no\" good also"))
cli::cli_dl(c("test_3" = "no' good either"))
cli::cli_dl(c("test_4" = "no\" good also"))
cli::cli_text("{.url https://example.com/#section}")
# cli::cli_alert_success("Qapla'")
cli::cli_alert_success("Qapla'")
})
})

test_that("quotes, etc. within expressions are still OK", {
expect_snapshot({
# cli::cli_text("{.url URL} {x <- 'foo'; nchar(x)}")
# cli::cli_text("{.url URL} {x <- \"foo\"; nchar(x)}")
cli::cli_text("{.url URL} {x <- 'foo'; nchar(x)}")
cli::cli_text("{.url URL} {x <- \"foo\"; nchar(x)}")
cli::cli_text("{.url URL} {1 + 1 # + 1} {1 + 1}")
})
})
Expand Down

0 comments on commit 8d51628

Please sign in to comment.