Skip to content

Commit 4fa2bb2

Browse files
committed
add test for print method, closes #15
1 parent 923beaa commit 4fa2bb2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/testthat/test-misc.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ test_that("str method works as expected", {
132132
expect_equal(out, paste0(header, vec, " "))
133133
})
134134

135+
test_that("print method returns the object invisibly", {
136+
x <- set_quantities(runif(5), "m", 0.01)
137+
138+
expect_output(x1 <- print(x))
139+
expect_identical(x, x1)
140+
})
141+
135142
test_that("duplicated-related methods work as expected", {
136143
x <- set_quantities(1:4, m, rep(c(0.1, 0.2), 2))
137144
expect_equal(duplicated(x), duplicated(drop_errors(x)))

0 commit comments

Comments
 (0)