Skip to content

Commit 6137ce8

Browse files
authored
Added test for dbQuoteString (#228)
1 parent 0840ecf commit 6137ce8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/testthat/test-dbQuoteString.R

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
context("dbQuoteString")
2+
3+
test_that("quoting works", {
4+
if (!mysqlHasDefault()) skip("Test database not available")
5+
6+
con <- dbConnect(MySQL(), dbname = "test")
7+
on.exit(dbDisconnect(con))
8+
9+
expect_equal(dbQuoteString(con, "\\'"), SQL("'\\\\\\''"))
10+
expect_equal(dbQuoteString(con, "'"), SQL("'\\''"))
11+
})

0 commit comments

Comments
 (0)