diff --git a/Commands/Add.hs b/Commands/Add.hs index f4c2a50d7..5f5e337f8 100644 --- a/Commands/Add.hs +++ b/Commands/Add.hs @@ -191,21 +191,3 @@ transactionsSimilarTo l s = ts = ledger_txns $ rawledger l 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: -@ - --} diff --git a/tests/add-bad-date-fails.test b/tests/add-bad-date-fails.test new file mode 100644 index 000000000..2c16a7e5f --- /dev/null +++ b/tests/add-bad-date-fails.test @@ -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 : diff --git a/tests/add-blank-date.test b/tests/add-blank-date.test new file mode 100644 index 000000000..23d14689c --- /dev/null +++ b/tests/add-blank-date.test @@ -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: diff --git a/tests/add-blank-description-fails.test b/tests/add-blank-description-fails.test new file mode 100644 index 000000000..2975766d4 --- /dev/null +++ b/tests/add-blank-description-fails.test @@ -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: