-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul R. Hibbing
committed
Dec 5, 2020
1 parent
80dcc24
commit ac1456d
Showing
6 changed files
with
56 additions
and
3 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
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,47 @@ | ||
context("agd file reading") | ||
library(AGread) | ||
|
||
## MANUAL LEGACY TEST (verified 2/14/19) | ||
# AG_legacy <- readRDS("data-raw/counts_legacy.rds") | ||
# AG <- read_AG_counts( | ||
# system.file( | ||
# "extdata", "example1sec.csv", package = "AGread" | ||
# ), verbose = TRUE, skip = 11 | ||
# ) | ||
# > all.equal(AG, AG_legacy) | ||
# [1] TRUE | ||
|
||
testthat::test_that("agd file reading produces expected output", { | ||
|
||
agd <- system.file( | ||
"extdata", "example1sec.agd", package = "AGread" | ||
) | ||
|
||
csv <- system.file( | ||
"extdata", "example1sec.csv", package = "AGread" | ||
) | ||
|
||
test <- read_agd(agd) | ||
ref <- read_AG_counts(csv) | ||
|
||
testthat::expect_equal_to_reference( | ||
test, "agd_read_cache.rds" | ||
) | ||
|
||
test2 <- read_agd(agd, "settings") | ||
test3 <- read_agd(agd, "data") | ||
test4 <- read_agd(agd, "both") | ||
|
||
format_test <- all( | ||
identical(test, test3), | ||
identical(test, test4$data), | ||
identical(test2, test4$settings), | ||
identical(class(test), class(ref)), | ||
identical(class(test4$data), class(ref)) | ||
) | ||
|
||
testthat::expect_true(format_test) | ||
|
||
testthat::expect_equal(test, ref, scale = 1) | ||
|
||
}) |
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