Skip to content

Commit

Permalink
feat: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nahid18 committed Sep 27, 2023
1 parent dbb5644 commit 12b8611
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: easylift
Title: An R package to perform genomic liftover
Version: 0.99.92
Version: 0.99.93
Date: 2023-09-25
Authors@R:
c(
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ gr |> easylift("hg38")
To cite package `easylift` in publications use:

Al Nahid A, Love M (2023). _easylift: An R package to perform
genomic liftover_. R package version 0.99.92,
genomic liftover_. R package version 0.99.93,
<https://github.com/nahid18/easylift>.


Expand All @@ -90,7 +90,7 @@ A BibTeX entry for LaTeX users is
title = {easylift: An R package to perform genomic liftover},
author = {Abdullah Al Nahid and Michael Love},
year = {2023},
note = {R package version 0.99.92},
note = {R package version 0.99.93},
url = {https://github.com/nahid18/easylift},
}
```
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ gr |> easylift("hg38")
To cite package `easylift` in publications use:

Al Nahid A, Love M (2023). *easylift: An R package to perform genomic
liftover*. R package version 0.99.92,
liftover*. R package version 0.99.93,
<https://github.com/nahid18/easylift>.

A BibTeX entry for LaTeX users is
Expand All @@ -86,7 +86,7 @@ A BibTeX entry for LaTeX users is
title = {easylift: An R package to perform genomic liftover},
author = {Abdullah Al Nahid and Michael Love},
year = {2023},
note = {R package version 0.99.92},
note = {R package version 0.99.93},
url = {https://github.com/nahid18/easylift},
}

Expand Down
8 changes: 5 additions & 3 deletions tests/testthat/test-easylift.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ test_that("easylift function tests with valid chain files", {
easylift(x = gr2, to = "hg38", chain = chain_path),
easylift(x = gr2, to = "hg38", chain = chain_path_gz)
)
expect_error(easylift(gr2, "hg38", BiocFileCache::BiocFileCache()))

expect_no_error(easylift(gr2, "hg38"))
expect_no_error(gr2 |> easylift("hg38"))
expect_error(gr2 |> easylift("hg38", BiocFileCache::BiocFileCache()))
expect_no_error(easylift(gr2, "hg38", NULL, BiocFileCache::BiocFileCache()))
expect_no_error(gr2 |> easylift("hg38", NULL, NULL))
expect_no_error(gr2 |> easylift("hg38", NULL))
})
Expand Down Expand Up @@ -99,6 +97,10 @@ test_that("easylift succeeds with BiocFileCache", {

genome(gr) <- "hg19"

expect_error(easylift(gr, "hg38", bfc))
expect_error(gr |> easylift("hg38", bfc))
expect_no_error(easylift(gr, "hg38", NULL, bfc))

# Test success when bfc is provided
tryCatch({
result <- easylift(x = gr, to = "hg38", bfc = bfc)
Expand Down

0 comments on commit 12b8611

Please sign in to comment.