Skip to content

Commit

Permalink
Add test to reproduce the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia-Kosenkov committed Aug 4, 2024
1 parent c456fe1 commit 7391b1f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test-source.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,20 @@ test_that("`rust_source()` should not raise internal error for code without exte

expect_no_error(rust_source(code = "fn test() {}"))
})

# https://github.com/extendr/rextendr/issues/356
test_that("`rust_function()` supports `r#` prefix in rust function names", {
skip_if_cargo_unavailable()

rust_fn_src <- "
fn r#true() -> &'static str {
\"Specially-named function has been called\"
}
"

rust_function(
code = rust_fn_src
)

expect_equal(true(), "Specially-named function has been called")
})

0 comments on commit 7391b1f

Please sign in to comment.