-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- completeness in ici_kt - more testing - fixes check_timing (was broken, and never tested)
- Loading branch information
Showing
13 changed files
with
83 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
test_that("logger detection works", { | ||
new_lib = tempfile() | ||
dir.create(new_lib) | ||
withr::with_libpaths(new_lib, { | ||
expect_error(enable_logging(), "Logging requested") | ||
}) | ||
unlink(new_lib, recursive = TRUE) | ||
}) | ||
|
||
test_that("logging works", { | ||
enable_logging("nomemory_logs.log") | ||
|
||
set.seed(1234) | ||
x = matrix(rnorm(5000), nrow = 50, ncol = 100) | ||
colnames(x) = paste0("s", seq(1, ncol(x))) | ||
ici_res = ici_kendalltau(x) | ||
|
||
log_contents = readLines("nomemory_logs.log") | ||
|
||
expect_false(all(grepl("Memory", log_contents))) | ||
|
||
enable_logging("withmemory_logs.log", memory = TRUE) | ||
ici_res = ici_kendalltau(x) | ||
log_contents = readLines("withmemory_logs.log") | ||
expect_true(any(grepl("Memory", log_contents))) | ||
unlink("nomemory_logs.log", recursive = TRUE) | ||
unlink("withmemory_logs.log", recursive = TRUE) | ||
}) | ||
|
||
test_that("progress works", { | ||
show_progress() | ||
|
||
set.seed(1234) | ||
x = matrix(rnorm(5000), nrow = 50, ncol = 100) | ||
colnames(x) = paste0("s", seq(1, ncol(x))) | ||
expect_message(ici_kendalltau(x), "Processing missing values") | ||
}) |
Oops, something went wrong.