Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fdt() issues with locale #12

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ jobs:
- {os: macos-11, r: '4.2'}
- {os: windows-latest, r: '4.1'}
- {os: windows-latest, r: '4.2'}
- {os: ubuntu-latest, r: '3.6'}
- {os: windows-latest, r: '4.3.2'}
- {os: windows-latest, r: '4.4'}

# - {os: ubuntu-latest, r: '3.6'}
- {os: ubuntu-latest, r: '4.0'}
- {os: ubuntu-latest, r: '4.1'}
- {os: ubuntu-latest, r: '4.2'}
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Depends:
R (>= 3.2.0)
Suggests:
covr,
testthat (>= 3.0.0)
testthat (>= 3.0.0),
withr
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
Config/testthat/parallel: true
36 changes: 36 additions & 0 deletions tests/testthat/test-fdt-locale2
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# compare output of this test vs the other one.
test_that("fdt() works with non-standard locale when LC_TIME = 'en_CA' (#11).", {
withr::local_locale("LC_TIME" = "en_CA")
expect_no_error(
res0 <- fdt(
input = "2021-01-09 16:32(America/Toronto)",
format = flex_t12_lst$hms,
locale = "en"
)
)
expect_no_error(
res1 <- fdt(
input = "2021-01-09 16:32(America/Toronto)",
format = flex_t12_lst$hms,
locale = "en"
)
)
})

test_that("fdt() works with non-standard locale when LC_TIME = 'fr_CA' (#11).", {
withr::local_locale("LC_TIME" = "fr_CA")

expect_no_error(
res0 <- fdt(
input = "2021-01-09 16:32(America/Toronto)",
format = flex_t12_lst$hms,
)
)
expect_no_error(
res1 <- fdt(
input = "2021-01-09 16:32(America/Toronto)",
format = flex_t12_lst$hms,
locale = "en"
)
)
})
Loading