Skip to content

Commit

Permalink
Add a test for #248
Browse files Browse the repository at this point in the history
  b439a9e fixed #248
  • Loading branch information
vspinu committed Oct 1, 2015
1 parent b439a9e commit 7eb54a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/testthat/test-pretty.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@ test_that("pretty_dates works for years",
expect_equal(pretty_dates(c(as.Date("1993-12-05"), as.Date("2007-12-01")), 7),
ymd(c("1993-01-01 UTC", "1995-01-01 UTC", "1997-01-01 UTC",
"1999-01-01 UTC", "2001-01-01 UTC", "2003-01-01 UTC",
"2005-01-01 UTC", "2007-01-01 UTC")))
"2005-01-01 UTC", "2007-01-01 UTC")))

## https://github.com/hadley/lubridate/issues/248
expect_equal(
pretty_dates(ymd_hms("2014-02-05 22:45:46 GMT", "2014-03-03 14:28:20"), 10),
ymd(c("2014-02-05 UTC", "2014-02-07 UTC", "2014-02-09 UTC", "2014-02-11 UTC",
"2014-02-13 UTC", "2014-02-15 UTC", "2014-02-17 UTC", "2014-02-19 UTC",
"2014-02-21 UTC", "2014-02-23 UTC", "2014-02-25 UTC", "2014-02-27 UTC",
"2014-03-01 UTC", "2014-03-03 UTC")))
})

0 comments on commit 7eb54a0

Please # to comment.