move add command doctests to shell tests
This commit is contained in:
parent
e3e935e129
commit
e110976b47
@ -191,21 +191,3 @@ transactionsSimilarTo l s =
|
|||||||
ts = ledger_txns $ rawledger l
|
ts = ledger_txns $ rawledger l
|
||||||
threshold = 0
|
threshold = 0
|
||||||
|
|
||||||
{- doctests
|
|
||||||
|
|
||||||
@
|
|
||||||
$ echo "2009/13/1"|hledger -f /dev/null add 2>&1|tail -1|sed -e's/\[[^]]*\]//g' # a bad date is not accepted
|
|
||||||
date : date :
|
|
||||||
@
|
|
||||||
|
|
||||||
@
|
|
||||||
$ echo|hledger -f /dev/null add 2>&1|tail -1|sed -e's/\[[^]]*\]//g' # a blank date is ok
|
|
||||||
date : description:
|
|
||||||
@
|
|
||||||
|
|
||||||
@
|
|
||||||
$ printf "\n\n"|hledger -f /dev/null add 2>&1|tail -1|sed -e's/\[[^]]*\]//g' # a blank description should fail
|
|
||||||
date : description: description:
|
|
||||||
@
|
|
||||||
|
|
||||||
-}
|
|
||||||
|
|||||||
4
tests/add-bad-date-fails.test
Normal file
4
tests/add-bad-date-fails.test
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
; ignore the binary we are invoked with
|
||||||
|
-f/dev/null; echo "2009/1/32" | hledger add 2>&1 | tail -1 | sed -e's/\[[^]]*\]//g'
|
||||||
|
>>>
|
||||||
|
date : date :
|
||||||
4
tests/add-blank-date.test
Normal file
4
tests/add-blank-date.test
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
; ignore the binary we are invoked with
|
||||||
|
-f/dev/null; echo | hledger add 2>&1 |tail -1 |sed -e's/\[[^]]*\]//g'
|
||||||
|
>>>
|
||||||
|
date : description:
|
||||||
4
tests/add-blank-description-fails.test
Normal file
4
tests/add-blank-description-fails.test
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
; ignore the binary we are invoked with
|
||||||
|
-f/dev/null; printf "\n\n" | hledger add 2>&1 |tail -1 | sed -e's/\[[^]]*\]//g'
|
||||||
|
>>>
|
||||||
|
date : description: description:
|
||||||
Loading…
Reference in New Issue
Block a user