-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
coxph
) and UI messaging (#261)
* Add disclaimer for coxph (plus `markdown = TRUE`) * Adjust logic for UI messaging * Add test for UI logic * Redocument * Redact real object size for snapshots, just in case * More readable redaction * Fix abs value * No more quotes, which seem weird for numbers in a sentence * Render README
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generate expected UI messages | ||
|
||
Code | ||
assess_object(big, small) | ||
Message | ||
v Memory released: <redacted> | ||
Code | ||
assess_object(small, small) | ||
Message | ||
x No memory released. Do not butcher. | ||
Code | ||
assess_object(small, big) | ||
Message | ||
x The butchered object is <redacted> larger than the original. Do not butcher. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
test_that("Generate expected UI messages", { | ||
big <- runif(1e4) | ||
big <- add_butcher_class(big) | ||
small <- runif(1e3) | ||
small <- add_butcher_class(small) | ||
obj_size_diff <- lobstr::obj_size(big) - lobstr::obj_size(small) | ||
obj_size_diff <- format(obj_size_diff, big.mark = ",", scientific = FALSE) | ||
|
||
expect_snapshot({ | ||
assess_object(big, small) | ||
assess_object(small, small) | ||
assess_object(small, big) | ||
}, | ||
transform = function(x) gsub(obj_size_diff, "<redacted>", x, fixed = TRUE) | ||
) | ||
}) |