Skip to content

Commit

Permalink
uncomment a test
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Oct 18, 2023
1 parent 5e5473a commit 55a8358
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/_snaps/csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,18 @@
18h00m - 01/01/2020
00h00m - 02/01/2020

# write_csv: time_format works

Code
cat(readLines(path), sep = "\n")
Output
date
22h00m00s
22h15m00s
22h30m00s
22h45m00s
23h00m00s

# write_csv: float_precision works

Code
Expand Down
25 changes: 12 additions & 13 deletions tests/testthat/test-csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,18 @@ test_that("write_csv: datetime_format works", {
expect_snapshot_file(temp_out)
})

# TODO: uncomment this when $dt$time is implemented
# test_that("write_csv: time_format works", {
# dat <- pl$DataFrame(
# date = pl$date_range(
# strptime("00:00:00", format = "%H:%M:%S"),
# strptime("01:00:00", format = "%H:%M:%S"),
# interval = "15m",
# eager = TRUE
# )$dt$time()
# )
# dat$write_csv(temp_out, time_format = "%Hh%Mm%%Ss")
# expect_snapshot_file(temp_out)
# })
test_that("write_csv: time_format works", {
dat <- pl$DataFrame(
date = pl$date_range(
strptime("00:00:00", format = "%H:%M:%S"),
strptime("01:00:00", format = "%H:%M:%S"),
interval = "15m",
eager = TRUE
)
)$with_columns(pl$col("date")$dt$time())
dat$write_csv(temp_out, time_format = "%Hh%Mm%Ss")
expect_snapshot_file(temp_out)
})


test_that("write_csv: float_precision works", {
Expand Down

0 comments on commit 55a8358

Please sign in to comment.