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

Don't test with now-invalid tz names #310

Merged
merged 1 commit into from
Sep 22, 2023
Merged
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
19 changes: 4 additions & 15 deletions tests/testthat/test-mime.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
test_that("`format_rfc2822_date()` produces valid dates", {

# Expect properly formatted POSIXct date-times
# with varying time zones
# Expect properly formatted POSIXct date-times with varying time zones
format_rfc2822_date(
ISOdatetime(2019, 6, 15, 20, 18, 00, tz = "Europe/Paris")) %>%
expect_equal("Sat, 15 Jun 2019 20:18:00 +0200")
Expand All @@ -18,21 +17,12 @@ test_that("`format_rfc2822_date()` produces valid dates", {
ISOdatetime(2019, 6, 15, 20, 18, 00, tz = "GMT0")) %>%
expect_equal("Sat, 15 Jun 2019 20:18:00 +0000")

format_rfc2822_date(
ISOdatetime(2019, 6, 15, 20, 18, 00, tz = "Iran")) %>%
expect_equal("Sat, 15 Jun 2019 20:18:00 +0450")

format_rfc2822_date(
ISOdatetime(2019, 6, 15, 20, 18, 00, tz = "Japan")) %>%
expect_equal("Sat, 15 Jun 2019 20:18:00 +0900")

# Expect that day values don't have a leading `0`
format_rfc2822_date(
ISOdatetime(2015, 6, 2, 20, 18, 00, tz = "America/Los_Angeles")) %>%
expect_equal("Tue, 2 Jun 2015 20:18:00 -0700")

# Expect properly formatted POSIXlt date-times
# with varying time zones
# Expect properly formatted POSIXlt date-times with varying time zones
format_rfc2822_date(
ISOdatetime(2019, 6, 15, 20, 18, 00, tz = "Europe/Paris") %>% as.POSIXlt()
) %>%
Expand All @@ -53,15 +43,14 @@ test_that("varying formats for recipient lists work as expected", {

# Named vs. unnamed recipients (or some named and some unnamed)
# Recipients with Unicode characters and double-quotes in their display names
# Single vs. multi recipients
# Single vs. multiple recipients

# Create an empty email message
email <- compose_email()

email_date <- ISOdatetime(2015, 6, 2, 20, 18, 00, tz = "America/Los_Angeles")

# Test resulting MIME messages with variations
# in email address lists
# Test resulting MIME messages with variations in email address lists
generate_rfc2822(
eml = email,
date = email_date,
Expand Down
Loading