Skip to content

Commit

Permalink
since we format numbers to strings now we have to do it for pbp insid…
Browse files Browse the repository at this point in the history
…e tests so we can access the actual numbers in other tests
  • Loading branch information
mrcaseb committed Dec 22, 2022
1 parent 59f958d commit f63fcfb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/testthat/test-build_nflfastR_pbp.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ test_that("build_nflfastR_pbp works (on CRAN)", {
# so it can't break because of failed downloads
pbp <- load_test_pbp(dir = test_dir)
expect_s3_class(pbp, "nflverse_data")
pbp <- strip_nflverse_attributes(pbp)
pbp <- strip_nflverse_attributes(pbp) %>%
# we gotta round floating point numbers because of different model output
# across platforms
round_double_to_digits()
exp <- load_expectation("pbp")
expect_equal(pbp, exp)
})
Expand All @@ -14,7 +17,10 @@ test_that("build_nflfastR_pbp works (outside CRAN)", {
skip_on_cran()
skip_if_offline("github.com")
pbp <- load_test_pbp(dir = NULL)
pbp <- strip_nflverse_attributes(pbp)
pbp <- strip_nflverse_attributes(pbp) %>%
# we gotta round floating point numbers because of different model output
# across platforms
round_double_to_digits()
exp <- load_expectation("pbp")
expect_equal(pbp, exp)
})

0 comments on commit f63fcfb

Please sign in to comment.