diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2014-02-11 09:47:38 +0100 |
---|---|---|
committer | Alexis Hildebrandt <afh@surryhill.net> | 2014-02-19 06:52:43 +0100 |
commit | 90988feebcd2f37c2715627d53b9c4a12dea51a5 (patch) | |
tree | 533ef41178c671159a2063ff13b327733bc87e77 | |
parent | be6f3cb2696894b55720cf9063cd508ebeae9f1d (diff) | |
download | fork-ledger-90988feebcd2f37c2715627d53b9c4a12dea51a5.tar.gz fork-ledger-90988feebcd2f37c2715627d53b9c4a12dea51a5.tar.bz2 fork-ledger-90988feebcd2f37c2715627d53b9c4a12dea51a5.zip |
DocTests: Allow multiple example inputs
to be used as single ledger data for an example command
-rw-r--r-- | doc/ledger3.texi | 13 | ||||
-rwxr-xr-x | test/DocTests.py | 5 |
2 files changed, 15 insertions, 3 deletions
diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 0d337b86..ac5939aa 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -700,7 +700,7 @@ owe. ``Liabilities'' is just a more inclusive name for Debts. An Asset is typically increased by transferring money from an Income account, such as when you get paid. Here is a typical transaction: -@smallexample +@smallexample @c input:6B43DD4 2004/09/29 My Employer Assets:Checking $500.00 Income:Salary @@ -715,7 +715,7 @@ borrow money to buy something, or if you owe someone money. Here is an example of increasing a MasterCard liability by spending money with it: -@smallexample +@smallexample @c input:6B43DD4 2004/09/30 Restaurant Expenses:Dining $25.00 Liabilities:MasterCard @@ -729,10 +729,17 @@ offsets the value of your assets. The combined total of your Assets and Liabilities is your net worth. So to see your current net worth, use this command: -@smallexample +@smallexample @c command:6B43DD4 $ ledger balance ^assets ^liabilities @end smallexample +@smallexample @c output:6B43DD4 + $500.00 Assets:Checking + $-25.00 Liabilities:MasterCard +-------------------- + $475.00 +@end smallexample + In a similar vein, your Income accounts show up negative, because they transfer money @emph{from} an account in order to increase your assets. Your Expenses show up positive because that is where the diff --git a/test/DocTests.py b/test/DocTests.py index a50ec03d..60d8c637 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -68,6 +68,11 @@ class DocTests: except KeyError: self.examples[test_id] = dict() + try: + example = self.examples[test_id][test_kind][test_kind] + example + except KeyError: + pass + self.examples[test_id][test_kind] = { 'bpos': test_begin_pos, 'epos': test_end_pos, |