Skip to content

Commit

Permalink
Pass ... to check_roundtrip()
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Oct 4, 2023
1 parent d1d100a commit 07c5cd9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/snapshot-value.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ expect_snapshot_value <- function(x,
load(save(x)),
label = lab,
style = style,
...,
tolerance = tolerance
)

Expand Down
16 changes: 16 additions & 0 deletions tests/testthat/_snaps/snapshot-value.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@

1.2

---

WAoAAAACAAQCAwACAwAAAAMGAAAEAgAAAAEABAAJAAAABWNsYXNzAAAAEAAAAAEABAAJAAAA
B2Zvcm11bGEAAAQCAAAAAQAEAAkAAAAMLkVudmlyb25tZW50AAAABAAAAAAAAAAEAAAAAAAA
AAQAAAAAAAAA+QAAAAAAAAACAAQACQAAAAh0ZXN0dGhhdAAEAAkAAAAFMy4yLjAAAAD+AAAA
EwAAAB0AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4A
AAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA
/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAAEwAAAB0AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4A
AAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA
/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAAEwAAAB0A
AAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA
/gAAAP4AAAQCAAAAAQAEAAkAAAABZgAAAwYAAAQCAAAB/wAAABAAAAABAAQACQAAAAdmb3Jt
dWxhAAAEAgAAAv8AAAP/AAAA/gAAAAEABAAJAAAAAX4AAAACAAAADgAAAAE/8AAAAAAAAAAA
AP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAD+
AAAA/gAAAP4AAAD+AAAI/wAAAAIAAAAOAAAAAT/wAAAAAAAAAAAA/g==

# tolerance passed to check_roundtrip

0.9
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-snapshot-value.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ test_that("can snapshot values", {

test_that("can control snapshot value details", {
expect_snapshot_value(1.2, tolerance = 0.1)

# including through ...
f <- ~ 1
expect_snapshot_value(f, style = "serialize", ignore_formula_env = TRUE)
})

test_that("tolerance passed to check_roundtrip", {
Expand Down

0 comments on commit 07c5cd9

Please sign in to comment.