File: test-arithmetic.R

package info (click to toggle)
r-cran-clock 0.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,856 kB
  • sloc: cpp: 19,565; sh: 17; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 802 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# ------------------------------------------------------------------------------
# add_*()

test_that("arithmetic helpers throw default error", {
  x <- 1

  expect_snapshot(error = TRUE, {
    add_years(x)
  })
  expect_snapshot(error = TRUE, {
    add_quarters(x)
  })
  expect_snapshot(error = TRUE, {
    add_months(x)
  })
  expect_snapshot(error = TRUE, {
    add_weeks(x)
  })
  expect_snapshot(error = TRUE, {
    add_days(x)
  })
  expect_snapshot(error = TRUE, {
    add_hours(x)
  })
  expect_snapshot(error = TRUE, {
    add_minutes(x)
  })
  expect_snapshot(error = TRUE, {
    add_seconds(x)
  })
  expect_snapshot(error = TRUE, {
    add_milliseconds(x)
  })
  expect_snapshot(error = TRUE, {
    add_microseconds(x)
  })
  expect_snapshot(error = TRUE, {
    add_nanoseconds(x)
  })
})