-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic parsing of dependencies and phases
- Loading branch information
Showing
8 changed files
with
266 additions
and
1 deletion.
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
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
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,25 @@ | ||
test_that("can solve dependencies for trivial system", { | ||
expect_equal(topological_order(list()), | ||
list(success = TRUE, value = integer())) | ||
expect_equal(topological_order(list(a = character())), | ||
list(success = TRUE, value = 1)) | ||
expect_equal(topological_order(list(a = character(), b = character())), | ||
list(success = TRUE, value = 1:2)) | ||
}) | ||
|
||
|
||
test_that("can solve dependencies for simple system", { | ||
deps <- list(a = character(), b = "a", c = "b") | ||
expect_equal(topological_order(deps), | ||
list(success = TRUE, value = 1:3)) | ||
deps <- list(a = character(), b = "a", c = "b") | ||
expect_equal(topological_order(rev(deps)), | ||
list(success = TRUE, value = 3:1)) | ||
}) | ||
|
||
|
||
test_that("can report back on cyclic dependencies", { | ||
deps <- list(x = character(), y = "x", a = "c", b = "a", c = "a") | ||
expect_equal(topological_order(deps), | ||
list(success = FALSE, error = 3:5)) | ||
}) |
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
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