Skip to content

Commit 03680f3

Browse files
committed
Remove duplicate naive test. Move sys test to test-sys-time.R.
Should have been part of #211
1 parent 3f3636a commit 03680f3

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

tests/testthat/test-sys-time.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ test_that("failure to parse throws a warning", {
120120
expect_snapshot(sys_time_parse("foo"))
121121
})
122122

123+
# ------------------------------------------------------------------------------
124+
# format()
125+
126+
test_that("allows `%z` and `%Z`", {
127+
x <- sys_seconds(0)
128+
expect_identical(format(x, format = "%z"), "+0000")
129+
expect_identical(format(x, format = "%Ez"), "+00:00")
130+
expect_identical(format(x, format = "%Z"), "UTC")
131+
})
132+
123133
# ------------------------------------------------------------------------------
124134
# as_zoned_time()
125135

tests/testthat/test-time-point.R

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,6 @@ test_that("`max` defaults to `getOption('max.print')` but can be overridden", {
2727
expect_snapshot(print(x, max = 5))
2828
})
2929

30-
# ------------------------------------------------------------------------------
31-
# format()
32-
33-
test_that("naive-time doesn't allow `%z` or `%Z`", {
34-
x <- naive_seconds(0)
35-
expect_identical(format(x, format = "%z"), NA_character_)
36-
expect_identical(format(x, format = "%Z"), NA_character_)
37-
})
38-
39-
test_that("sys-time allows `%z` and `%Z`", {
40-
x <- sys_seconds(0)
41-
expect_identical(format(x, format = "%z"), "+0000")
42-
expect_identical(format(x, format = "%Ez"), "+00:00")
43-
expect_identical(format(x, format = "%Z"), "UTC")
44-
})
45-
4630
# ------------------------------------------------------------------------------
4731
# time_point_floor() / _ceiling() / _round()
4832

0 commit comments

Comments
 (0)