forked from todotxt/todo.txt-cli
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to enforce use of $(...) code style in todo.sh.
Pull request todotxt#26 by trajano (e24777f) changed `...` to $(...), but the following commit 7900ad7 already added another old-style one. I think the tests can also be used for some simple enforcement of coding style, so here is a first shot at it. Closes todotxt#46
- Loading branch information
1 parent
f3af778
commit 2891472
Showing
2 changed files
with
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
test_description='no old-style backtick command substitution | ||
This test checks the todo.sh script itself for occurrences | ||
of old-style backtick command substitution, which should be | ||
replaced with $(...). | ||
' | ||
. ./test-lib.sh | ||
|
||
test_todo_session 'no old-style backtick command substitution' <<EOF | ||
>>> sed -n -e 's/[ \t]#.*//' -e '/\d96/{=;p}' "$(which todo.sh)" | ||
EOF | ||
|
||
test_done |
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