Skip to content

Commit f63fcfb

Browse files
committed
since we format numbers to strings now we have to do it for pbp inside tests so we can access the actual numbers in other tests
1 parent 59f958d commit f63fcfb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/testthat/test-build_nflfastR_pbp.R

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ test_that("build_nflfastR_pbp works (on CRAN)", {
33
# so it can't break because of failed downloads
44
pbp <- load_test_pbp(dir = test_dir)
55
expect_s3_class(pbp, "nflverse_data")
6-
pbp <- strip_nflverse_attributes(pbp)
6+
pbp <- strip_nflverse_attributes(pbp) %>%
7+
# we gotta round floating point numbers because of different model output
8+
# across platforms
9+
round_double_to_digits()
710
exp <- load_expectation("pbp")
811
expect_equal(pbp, exp)
912
})
@@ -14,7 +17,10 @@ test_that("build_nflfastR_pbp works (outside CRAN)", {
1417
skip_on_cran()
1518
skip_if_offline("github.com")
1619
pbp <- load_test_pbp(dir = NULL)
17-
pbp <- strip_nflverse_attributes(pbp)
20+
pbp <- strip_nflverse_attributes(pbp) %>%
21+
# we gotta round floating point numbers because of different model output
22+
# across platforms
23+
round_double_to_digits()
1824
exp <- load_expectation("pbp")
1925
expect_equal(pbp, exp)
2026
})

0 commit comments

Comments
 (0)