Skip to content

Commit a72d466

Browse files
authored
Assign result inside expect_warning() (#251)
1 parent 04f8b85 commit a72d466

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# clock (development version)
22

3+
* Updated a test related to upcoming changes in testthat.
4+
35
# clock 0.4.0
46

57
* New `date_start()` and `date_end()` for computing the date at the start or

tests/testthat/test-zoned-time.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,11 @@ test_that("%z must parse correctly if included", {
396396
expect <- as_zoned_time(sys_days(NA), "America/New_York")
397397
x <- "1970-01-01 00:00:00-0a:00 EST"
398398

399-
expect_identical(
400-
expect_warning(
401-
zoned_time_parse_abbrev(x, "America/New_York", format = "%Y-%m-%d %H:%M:%S%Ez %Z")
402-
),
403-
expect
399+
expect_warning(
400+
result <- zoned_time_parse_abbrev(x, "America/New_York", format = "%Y-%m-%d %H:%M:%S%Ez %Z")
404401
)
402+
403+
expect_identical(result, expect)
405404
})
406405

407406
test_that("multiple formats can be attempted", {

0 commit comments

Comments
 (0)