Skip to content

Commit

Permalink
Add missing timezone in tests (#1349)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgirlich authored Aug 8, 2023
1 parent c4f937f commit 5f92357
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-backend-access.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ test_that("custom escaping works as expected", {
expect_equal(escape(as.Date("2020-01-01"), con = con), sql("#2020-01-01#"))
expect_equal(escape(as.Date(NA), con = con), sql("NULL"))

expect_equal(escape(as.POSIXct("2020-01-01"), con = con), sql("#2020-01-01 00:00:00#"))
expect_equal(escape(as.POSIXct(NA), con = con), sql("NULL"))
expect_equal(escape(as.POSIXct("2020-01-01", tz = "UTC"), con = con), sql("#2020-01-01 00:00:00#"))
expect_equal(escape(as.POSIXct(NA, tz = "UTC"), con = con), sql("NULL"))
})

test_that("queries translate correctly", {
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-backend-mysql.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ test_that("custom date escaping works as expected", {
expect_equal(escape(as.Date("2020-01-01"), con = con), sql("'2020-01-01'"))
expect_equal(escape(as.Date(NA), con = con), sql("NULL"))

expect_equal(escape(as.POSIXct("2020-01-01"), con = con), sql("'2020-01-01 00:00:00'"))
expect_equal(escape(as.POSIXct(NA), con = con), sql("NULL"))
expect_equal(escape(as.POSIXct("2020-01-01", tz = "UTC"), con = con), sql("'2020-01-01 00:00:00'"))
expect_equal(escape(as.POSIXct(NA, tz = "UTC"), con = con), sql("NULL"))
})


Expand Down

0 comments on commit 5f92357

Please sign in to comment.