Skip to content

Commit

Permalink
Windows platform-specific path test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Sep 22, 2023
1 parent a48d50e commit ea0d47a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tests/testthat/test-cleanup.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ test_that("can cleanup explicit things quite well", {
names(status),
c("name", "root", "path", "role", "status", "delete", "unknown"))
expect_equal(status$name, "explicit")
expect_equal(status$root, root_open(path, FALSE, FALSE)$path)
expect_equal(normalise_path(status$root),
normalise_path(root_open(path, FALSE, FALSE)$path))
expect_equal(normalise_path(status$path),
normalise_path(file.path(status$root, "src", status$name)))
paths <- c("data.csv", "mygraph.png", "orderly.R")
Expand Down
8 changes: 5 additions & 3 deletions tests/testthat/test-root.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ test_that("can error with instructions if files are added to git", {

test_that("can identify a plain source root", {
info <- test_prepare_orderly_example_separate("explicit")
expect_equal(orderly_src_root(info$src, FALSE), normalizePath(info$src))
expect_equal(orderly_src_root(file.path(info$src, "src", "explicit"), TRUE),
normalizePath(info$src))
expect_equal(normalise_path(orderly_src_root(info$src, FALSE)),
normalise_path(info$src))
expect_equal(
orderly_src_root(file.path(info$src, "src", "explicit"), TRUE),
orderly_src_root(info$src, FALSE))
expect_error(
orderly_src_root(file.path(info$src, "src", "explicit"), FALSE),
"Did not find existing orderly source root in")
Expand Down

0 comments on commit ea0d47a

Please sign in to comment.