mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Added sample hooks that behave/misbehave in various ways.
This commit is contained in:
parent
1cfdfbae52
commit
3ff42af9c7
22 changed files with 421 additions and 0 deletions
19
test/test_hooks/on-add-reject
Normal file
19
test/test_hooks/on-add-reject
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
# The on-add event is triggered separately for each task added. This hook
|
||||
# script can accept/reject the addition. Processing will continue.
|
||||
|
||||
# Input:
|
||||
# - Line of JSON for proposed new task.
|
||||
read new_task
|
||||
|
||||
# Output:
|
||||
# - JSON, modified or unmodified.
|
||||
# - Optional feedback/error.
|
||||
echo $new_task
|
||||
echo 'FEEDBACK'
|
||||
|
||||
# Status:
|
||||
# - 0: JSON accepted, non-JSON is feedback.
|
||||
# - non-0: JSON ignored, non-JSON is error.
|
||||
exit 1
|
Loading…
Add table
Add a link
Reference in a new issue