Skip to content

Commit

Permalink
test toy dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
RossanaTat committed Jun 10, 2024
1 parent 8a9de3b commit 55904cf
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/testthat/test-toy_dirs.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
test_that("toy_dirs creates syncdr.env", {

toy_dirs()

# Check if the environment exists
expect_true(exists("syncdr.env",
envir = .GlobalEnv))

# Check paths exist
expect_true(exists("left",
envir = syncdr.env))
expect_true(exists("right",
envir = syncdr.env))

left <- syncdr.env$left
right <- syncdr.env$right

# Check if the directories exist
expect_true(fs::dir_exists(left))
expect_true(fs::dir_exists(right))

# Check dirs are not empty
expect_true(length(dir_ls(left,
recurse = TRUE)) > 0)
expect_true(length(dir_ls(right,
recurse = TRUE)) > 0)
})

0 comments on commit 55904cf

Please sign in to comment.