Skip to content

Commit

Permalink
More robust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Jan 25, 2024
1 parent c1705cf commit a35a3ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/testthat/_snaps/local.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
local_deps_tree(file.path(dld, "pkg4"))
Output
local::<tempdir>/<tempfile>
\-pkg2 1.0.0 [new][bld]
\-pkg1 1.0.0 [new][bld]
\-pkg2 1.0.0 [new][bld][dl] (<size>)
\-pkg1 1.0.0 [new][bld][dl] (<size>)
Key: [new] new | [bld] build
Key: [new] new | [dl] download | [bld] build

---

Code
local_dev_deps_tree(file.path(dld, "pkg4"))
Output
local::<tempdir>/<tempfile>
+-pkg2 1.0.0 [new][bld]
| \-pkg1 1.0.0 [new][bld]
\-pkg3 1.0.0 [new][bld]
+-pkg2 1.0.0 [new][bld][dl] (<size>)
| \-pkg1 1.0.0 [new][bld][dl] (<size>)
\-pkg3 1.0.0 [new][bld][dl] (<size>)
\-pkg2
Key: [new] new | [bld] build
Key: [new] new | [dl] download | [bld] build

---

Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-local.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ test_that("local_install", {
skip_on_cran()
lib <- withr::local_tempdir()
dld <- withr::local_tempdir()
cache_clean()
setup_fake_apps()

suppressMessages(dl <- pkg_download("pkg3", dld))
Expand All @@ -18,6 +19,7 @@ test_that("local_install_deps", {
skip_on_cran()
lib <- withr::local_tempdir()
dld <- withr::local_tempdir()
cache_clean()
setup_fake_apps()

suppressMessages(dl <- pkg_download("pkg4", dld))
Expand All @@ -38,6 +40,7 @@ test_that("local_install_dev_deps", {
skip_on_cran()
lib <- withr::local_tempdir()
dld <- withr::local_tempdir()
cache_clean()
setup_fake_apps()

suppressMessages(dl <- pkg_download("pkg4", dld))
Expand All @@ -58,6 +61,7 @@ test_that("local_deps & co", {
skip_on_cran()
lib <- withr::local_tempdir()
dld <- withr::local_tempdir()
cache_clean()
setup_fake_apps()

suppressMessages(dl <- pkg_download("pkg4", dld))
Expand Down

0 comments on commit a35a3ea

Please sign in to comment.