Skip to content

Commit af4fd33

Browse files
committed
added parameter name, made tolerance smaller
1 parent b969dee commit af4fd33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/testthat/test-ggplot-coord.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test_that("coord_fixed() is translated to the right height-width ratio", {
3131
x_range <- range(p$data$xval, na.rm = TRUE)
3232
y_range <- range(p$data$yval, na.rm = TRUE)
3333
yx_ratio <- (y_range[2] - y_range[1]) / (x_range[2] - x_range[1])
34-
expect_equal(la$height/la$width, yx_ratio * p$coordinates$ratio, 0.25)
34+
expect_equal(la$height/la$width, yx_ratio * p$coordinates$ratio, tolerance = 0.10)
3535
})
3636

3737
# Equal scaling, with each 1 on the x axis the same length as y on x axis
@@ -46,5 +46,5 @@ test_that("coord_fixed() is translated to the right height-width ratio", {
4646
x_range <- range(p$data$xval, na.rm = TRUE)
4747
y_range <- range(p$data$yval, na.rm = TRUE)
4848
yx_ratio <- (y_range[2] - y_range[1]) / (x_range[2] - x_range[1])
49-
expect_equal(la$height/la$width, yx_ratio * p$coordinates$ratio, 0.25)
49+
expect_equal(la$height/la$width, yx_ratio * p$coordinates$ratio, tolerance = 0.10)
5050
})

0 commit comments

Comments
 (0)