-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from hackberrydev/exit-code
Refactor and fix print errors and exit status
- Loading branch information
Showing
8 changed files
with
85 additions
and
26 deletions.
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
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,39 @@ | ||
(use judge) | ||
|
||
(import ../src/alas) | ||
|
||
## ————————————————————————————————————————————————————————————————————————————————————————————————— | ||
## Test run-with-file-path | ||
|
||
(deftest "returns exit status 0 when there were no errors" | ||
(let [arguments {"skip-backup" true "stats" true} | ||
[errors exit-status] (alas/run-with-file-path arguments "./test/examples/todo.md")] | ||
(test (empty? errors) true) | ||
(test exit-status 0))) | ||
|
||
(deftest "returns exit status 3 when there are file errors" | ||
(let [arguments {"skip-backup" true "stats" true} | ||
[errors exit-status] (alas/run-with-file-path arguments "./test/examples/missing-todo.md")] | ||
(test (empty? errors) false) | ||
(test exit-status 3))) | ||
|
||
(deftest "returns exit status 4 when there are parsing errors" | ||
(let [arguments {"skip-backup" true "stats" true} | ||
[errors exit-status] (alas/run-with-file-path arguments "./test/examples/unparsable-todo.md")] | ||
(test (empty? errors) false) | ||
(test exit-status 4))) | ||
|
||
## ————————————————————————————————————————————————————————————————————————————————————————————————— | ||
## Test run-with-arguments | ||
|
||
(deftest "returns exit status 0 when there were no errors" | ||
(let [arguments {"skip-backup" true "stats" true :default "./test/examples/todo.md"} | ||
[errors exit-status] (alas/run-with-arguments arguments)] | ||
(test (empty? errors) true) | ||
(test exit-status 0))) | ||
|
||
(deftest "returns exit status 2 when when the file path is missing" | ||
(let [arguments {"skip-backup" true "stats" true} | ||
[errors exit-status] (alas/run-with-arguments arguments)] | ||
(test (empty? errors) false) | ||
(test exit-status 2))) |
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,11 @@ | ||
# Main TODO | ||
|
||
# 2020-08-01, Saturday | ||
|
||
- [ ] Develop photos for the grandmother | ||
- [X] Pay bills | ||
|
||
# 2020-07-31, Friday | ||
|
||
- [X] Review open pull requests | ||
- [X] Fix flaky test |