diff --git a/tests/testthat/test-as_polars.R b/tests/testthat/test-as_polars.R index 31288484c..e9f37ec5d 100644 --- a/tests/testthat/test-as_polars.R +++ b/tests/testthat/test-as_polars.R @@ -401,6 +401,20 @@ patrick::with_parameters_test_that("clock package class support", as.POSIXct(as.vector(pl_sys_time), tz = "Asia/Kolkata"), as.POSIXct(clock_sys_time, tz = "Asia/Kolkata") ) + + # Test on other time zone + withr::with_envvar( + new = c(TZ = "Europe/Paris"), + { + expect_equal(as.POSIXct(as.vector(pl_naive_time)), as.POSIXct(clock_naive_time)) + expect_equal(as.POSIXct(as.vector(pl_zoned_time_1)), as.POSIXct(clock_zoned_time_1)) + expect_equal(as.POSIXct(as.vector(pl_sys_time)), as.POSIXct(clock_sys_time, tz = "UTC")) + expect_equal( + as.POSIXct(as.vector(pl_sys_time), tz = "Asia/Kolkata"), + as.POSIXct(clock_sys_time, tz = "Asia/Kolkata") + ) + } + ) }, precision = c("nanosecond", "microsecond", "millisecond", "second", "minute", "hour", "day"), .test_name = precision