Skip to content

Commit 231b6ae

Browse files
committed
test(db): fix fancy_scientific test by comparing deparsed expressions
Signed-off-by: Aritra Dey <adey01027@gmail.com>
1 parent 7556f42 commit 231b6ae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

base/db/tests/testthat/test.query.dplyr.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
test_that("`fancy_scientific()` converts numbers to scientific expressions with proper formatting", {
22
result <- fancy_scientific(1234567890)
3-
expect_equal(result, expression("1.234568" %*% 10^+9))
3+
expected <- expression("1.234568" %*% 10^+9)
4+
expect_equal(deparse(result[[1]]), deparse(expected[[1]]))
45

56
result <- fancy_scientific(0.00000123)
6-
expect_equal(result, expression("1.23" %*% 10^-6))
7+
expected <- expression("1.23" %*% 10^-6)
8+
expect_equal(deparse(result[[1]]), deparse(expected[[1]]))
79

810
result <- fancy_scientific(1e-20)
9-
expect_equal(result, expression("1" %*% 10^-20))
11+
expected <- expression("1" %*% 10^-20)
12+
expect_equal(deparse(result[[1]]), deparse(expected[[1]]))
1013
})
1114

1215
test_that("`dplyr.count()` returns the correct count of rows in a dataframe", {

0 commit comments

Comments
 (0)