Skip to content

Commit

Permalink
transition to vdiffr
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Jan 29, 2024
1 parent 33bf7c7 commit 78b8083
Show file tree
Hide file tree
Showing 28 changed files with 177 additions and 6,457 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Suggests:
shinytest,
spelling,
testthat (>= 3.0.0),
vdiffr,
withr
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
Expand Down
15 changes: 9 additions & 6 deletions tests/testthat/_snaps/display_selected.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@

Code
display_selected(org, performance, preds, "foo", input)
Error <vctrs_error_subscript_oob>
Can't subset columns that don't exist.
Condition
Error in `predictions[predictions$.config == sel_config, tuning_param]`:
! Can't subset columns that don't exist.
x Column `foo` doesn't exist.

---

Code
display_selected(org, performance, preds, tuning_param)
Error <simpleError>
argument "input" is missing, with no default
Condition
Error in `display_selected()`:
! argument "input" is missing, with no default

---

Code
display_selected(org, performance, tuning_param, input)
Error <simpleError>
argument "input" is missing, with no default
Condition
Error in `display_selected()`:
! argument "input" is missing, with no default

35 changes: 21 additions & 14 deletions tests/testthat/_snaps/first_level.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,55 @@

Code
first_level(preds, "second", "fact_col")
Error <rlang_error>
first_level() can only be used for a two-class variable
Condition
Error in `first_level()`:
! first_level() can only be used for a two-class variable

---

Code
first_level(preds, "Potato", "Class")
Error <rlang_error>
`event_level` must be one of "first" or "second", not "Potato".
Condition
Error in `first_level()`:
! `event_level` must be one of "first" or "second", not "Potato".

---

Code
first_level(preds, "first", "Potato")
Error <rlang_error>
'Potato' is not a column in the dataset
Condition
Error in `first_level()`:
! 'Potato' is not a column in the dataset

---

Code
first_level(preds, first, "Class")
Error <rlang_error>
`event_level` must be a character vector, not a function.
Condition
Error in `first_level()`:
! `event_level` must be a character vector, not a function.

---

Code
first_level(preds, 1, "Class")
Error <rlang_error>
`event_level` must be a character vector, not a number.
Condition
Error in `first_level()`:
! `event_level` must be a character vector, not the number 1.

---

Code
first_level(preds, "first", Class)
Error <simpleError>
object 'Class' not found
Condition
Error:
! object 'Class' not found

---

Code
first_level(preds, "first", "fact_col")
Error <rlang_error>
first_level() can only be used for a two-class variable
Condition
Error in `first_level()`:
! first_level() can only be used for a two-class variable

20 changes: 12 additions & 8 deletions tests/testthat/_snaps/first_level_prob_name.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@

Code
first_class_prob_name(preds, "Potato", "Class")
Error <rlang_error>
`event_level` must be one of "first" or "second", not "Potato".
Condition
Error in `first_level()`:
! `event_level` must be one of "first" or "second", not "Potato".

---

Code
first_class_prob_name(preds, "first", "Potato")
Error <rlang_error>
'Potato' is not a column in the dataset
Condition
Error in `first_level()`:
! 'Potato' is not a column in the dataset

---

Code
first_class_prob_name(preds, first, "Class")
Error <rlang_error>
`event_level` must be a character vector, not a function.
Condition
Error in `first_level()`:
! `event_level` must be a character vector, not a function.

---

Code
first_class_prob_name(preds, "first", Class)
Error <simpleError>
object 'Class' not found
Condition
Error:
! object 'Class' not found

3,804 changes: 38 additions & 3,766 deletions tests/testthat/_snaps/multiclass_plots.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 9 additions & 6 deletions tests/testthat/_snaps/organize_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@

Code
organize_data(lin_mod)
Error <rlang_error>
No `organize_data()` exists for this type of object.
Condition
Error in `organize_data()`:
! No `organize_data()` exists for this type of object.

---

Code
organize_data(dplyr::select(cars_bag_vfld, -.predictions))
Error <rlang_error>
The `.predictions` column does not exist. Refit with the control argument `save_pred = TRUE` to save predictions.
Condition
Error in `organize_data()`:
! The `.predictions` column does not exist. Refit with the control argument `save_pred = TRUE` to save predictions.

# can add hover column

Code
organize_data(cars_bag_vfld, hover_cols = c("mpg", "mpl"))
Error <vctrs_error_subscript_oob>
Can't subset columns that don't exist.
Condition
Error in `organize_data()`:
! Can't subset columns that don't exist.
x Column `mpl` doesn't exist.

906 changes: 24 additions & 882 deletions tests/testthat/_snaps/reg_plots.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 78b8083

Please sign in to comment.