Skip to content

Commit

Permalink
Test for and suppress expected warning during test
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaulrich committed Apr 11, 2023
1 parent a5b6041 commit 52ec2f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inst/tinytest/test-tclass.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ expect_equal(target, tclass(y))

info_msg <- "tclass() on object with no tclass/.indexCLASS returns POSIXct"
x <- structure(1:5, .Dim = c(5L, 1L), index = 1:5, class = c("xts", "zoo"))
expect_identical(c("POSIXct", "POSIXt"), tclass(x))
expect_warning(xtc <- tclass(x), "index does not have a 'tclass' attribute")
expect_identical(c("POSIXct", "POSIXt"), xtc)

0 comments on commit 52ec2f6

Please sign in to comment.