diff options
author | John Wiegley <johnw@newartisans.com> | 2011-02-12 17:31:49 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2011-02-12 18:11:26 -0500 |
commit | 9c62463f84dc398b41b387fbacce31abed7e4839 (patch) | |
tree | ba73122f301f477b8a4174bd1c3ff27334709ad0 | |
parent | 512542552b3e3e78f610f3d3f2fd1c8169188324 (diff) | |
download | fork-ledger-9c62463f84dc398b41b387fbacce31abed7e4839.tar.gz fork-ledger-9c62463f84dc398b41b387fbacce31abed7e4839.tar.bz2 fork-ledger-9c62463f84dc398b41b387fbacce31abed7e4839.zip |
Changed testing format to aid with debugging
174 files changed, 707 insertions, 867 deletions
diff --git a/test/RegressTests.py b/test/RegressTests.py index e176f8fc..28a6c709 100755 --- a/test/RegressTests.py +++ b/test/RegressTests.py @@ -38,52 +38,52 @@ class RegressFile(object): self.filename = filename self.fd = open(self.filename) - def is_directive(self, line): - return line == "<<<\n" or \ - line == ">>>\n" or \ - line == ">>>1\n" or \ - line == ">>>2\n" or \ - line.startswith("===") - def transform_line(self, line): line = re.sub('\$sourcepath', harness.sourcepath, line) return line - def read_section(self): - lines = [] - line = self.fd.readline() - while line and not self.is_directive(line): - lines.append(self.transform_line(line)) - line = self.fd.readline() - return (lines, line) - - def read_test(self, last_test = None): + def read_test(self): test = { 'command': None, - 'input': "", - 'output': "", - 'error': "", + 'output': None, + 'error': None, 'exitcode': 0 } - if last_test: - test['input'] = last_test['input'] + + in_output = False + in_error = False line = self.fd.readline() + #print "line =", line while line: - if line == "<<<\n": - (test['input'], line) = self.read_section() - elif line == ">>>\n" or line == ">>>1\n": - (test['output'], line) = self.read_section() - elif line == ">>>2\n": - (test['error'], line) = self.read_section() - elif line.startswith("==="): - match = re.match('=== ([0-9]+)', line) - assert match - test['exitcode'] = int(match.group(1)) - return test - else: - test['command'] = self.transform_line(line) - line = self.fd.readline() + if line.startswith("test "): + command = line[5:] + match = re.match('(.*) -> ([0-9]+)', command) + if match: + test['command'] = self.transform_line(match.group(1)) + test['exitcode'] = int(match.group(2)) + else: + test['command'] = command + in_output = True + + elif in_output: + if line.startswith("end test"): + in_output = in_error = False + break + elif in_error: + if test['error'] is None: + test['error'] = [] + test['error'].append(self.transform_line(line)) + else: + if line.startswith("__ERROR__"): + in_error = True + else: + if test['output'] is None: + test['output'] = [] + test['output'].append(self.transform_line(line)) + + line = self.fd.readline() + #print "line =", line return test['command'] and test @@ -97,22 +97,19 @@ class RegressFile(object): use_stdin = False if test['command'].find("-f - ") != -1: use_stdin = True - - test['command'] = '$ledger ' + test['command'] else: - tempdata = tempfile.mkstemp() - - os.write(tempdata[0], join(test['input'], '')) - os.close(tempdata[0]) - - test['command'] = (('$ledger -f "%s" ' % tempdata[1]) + + test['command'] = (('$ledger -f "%s" ' % self.filename) + test['command']) p = harness.run(test['command'], columns=(not re.search('--columns', test['command']))) if use_stdin: - p.stdin.write(join(test['input'], '')) + fd = open(self.filename) + try: + p.stdin.write(fd.read()) + finally: + fd.close() p.stdin.close() success = True @@ -125,7 +122,7 @@ class RegressFile(object): continue if not printed: if success: print - self.notify_user("Regression failure in output from %s:" % self.filename, test) + self.notify_user("FAILURE in output from %s:" % self.filename, test) success = False printed = True print " ", line, @@ -133,7 +130,7 @@ class RegressFile(object): printed = False index = 0 if test['error'] is not None: - for line in unified_diff([re.sub('\$FILE', tempdata[1], line) + for line in unified_diff([re.sub('\$FILE', self.filename, line) for line in test['error']], harness.readlines(p.stderr)): index += 1 @@ -141,14 +138,12 @@ class RegressFile(object): continue if not printed: if success: print - self.notify_user("Regression failure in error output from %s:" % self.filename, test) + self.notify_user("FAILURE in error output from %s:" + % self.filename, test) success = False printed = True print " ", line, - if not use_stdin: - os.remove(tempdata[1]) - if test['exitcode'] is None or test['exitcode'] == p.wait(): if success: harness.success() @@ -156,25 +151,25 @@ class RegressFile(object): harness.failure() else: if success: print - self.notify_user("Regression failure in exit code (%d (expected) != %d) from %s:" - % (test['exitcode'], p.returncode), test, self.filename) + if test['exitcode']: + self.notify_user("FAILURE in exit code (%d != %d) from %s:" + % (test['exitcode'], p.returncode, self.filename), + test) harness.failure() def run_tests(self): test = self.read_test() while test: self.run_test(test) - test = self.read_test(test) - return harness.failed + test = self.read_test() def close(self): self.fd.close() def do_test(path): entry = RegressFile(path) - failed = entry.run_tests() + entry.run_tests() entry.close() - return failed if __name__ == '__main__': if multiproc: diff --git a/test/baseline/cmd-print.test b/test/baseline/cmd-print.test index f5bb01e4..a3a4d857 100644 --- a/test/baseline/cmd-print.test +++ b/test/baseline/cmd-print.test @@ -1,9 +1,9 @@ -print --decimal-comma -<<< 2008/12/31 Market Expenses:Food ($10,00 + $2,50) Assets:Cash ->>>1 + +test print --decimal-comma 2008/12/31 Market Expenses:Food ($10,00 + $2,50) Assets:Cash +end test diff --git a/test/baseline/feat-balance-assignments.test b/test/baseline/feat-balance-assignments.test index fdf7be29..7b527ac7 100644 --- a/test/baseline/feat-balance-assignments.test +++ b/test/baseline/feat-balance-assignments.test @@ -1,5 +1,3 @@ -bal -<<< 2009/01/01 Entry Assets:Cash $10,000.00 Equity:Opening Balances @@ -27,9 +25,11 @@ bal 2009/02/05 Entry Expenses:Cash Assets:Cash = ($4,000.00 + $100.00) ->>>1 + +test bal $4,100.00 Assets:Cash $-10,000.00 Equity:Opening Balances $5,900.00 Expenses:Cash -------------------- 0 +end test diff --git a/test/baseline/feat-check.test b/test/baseline/feat-check.test index 18c7ccdf..a5f0c8ad 100644 --- a/test/baseline/feat-check.test +++ b/test/baseline/feat-check.test @@ -1,5 +1,3 @@ -bal -<<< = /Checking/ check account =~ /Foo/ @@ -8,11 +6,13 @@ bal Assets:Checking check account("Assets:Checking").all(account =~ /Expense/) ->>> + +test bal $-100 Assets:Checking $100 Expenses:Food -------------------- 0 ->>>2 +__ERROR__ Warning: Transaction check failed: (account =~ /Foo/) Warning: Check failed: account("Assets:Checking").all(account =~ /Expense/) +end test diff --git a/test/baseline/feat-fixated-prices.test b/test/baseline/feat-fixated-prices.test index 6b9faae8..f4370870 100644 --- a/test/baseline/feat-fixated-prices.test +++ b/test/baseline/feat-fixated-prices.test @@ -1,5 +1,3 @@ -reg -V gas -<<< 1990/01/01 Payee Expenses:Gas 100 GAL {=$2} Liabilities:MasterCard $-200 @@ -15,21 +13,10 @@ P 1990/02/15 12:00:00 FOO $3 1990/02/20 Payee Expenses:Gas 100 FOO Liabilities:MasterCard ->>>1 + +test reg -V gas 90-Jan-01 Payee Expenses:Gas $200 $200 90-Feb-01 Payee Expenses:Gas $200 $400 90-Feb-20 Commodities revalued <Revalued> $100 $500 90-Feb-20 Payee Expenses:Gas $300 $800 -=== 0 -reg -<<< -fixed XCD $0.374531835206 - -2008/04/08 KFC - Expenses:Food XCD 43.00 - Assets:Cash - -end fixed ->>> -08-Apr-08 KFC Expenses:Food XCD 43.00 XCD 43.00 - Assets:Cash XCD -43.00 0 +end test diff --git a/test/baseline/feat-fixated-prices_2.test b/test/baseline/feat-fixated-prices_2.test new file mode 100644 index 00000000..b7b71c83 --- /dev/null +++ b/test/baseline/feat-fixated-prices_2.test @@ -0,0 +1,12 @@ +fixed XCD $0.374531835206 + +2008/04/08 KFC + Expenses:Food XCD 43.00 + Assets:Cash + +end fixed + +test reg +08-Apr-08 KFC Expenses:Food XCD 43.00 XCD 43.00 + Assets:Cash XCD -43.00 0 +end test diff --git a/test/baseline/opt-abbrev-len.test b/test/baseline/opt-abbrev-len.test index 4bec90b4..bbd9a00e 100644 --- a/test/baseline/opt-abbrev-len.test +++ b/test/baseline/opt-abbrev-len.test @@ -1,9 +1,9 @@ -reg --abbrev-len=4 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --abbrev-len=4 07-Feb-02 RD VMMXX Asse:Inve:Vangua:VMMXX 0.350 VMMXX 0.350 VMMXX Inco:Divi:Vangua:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-account-width.test b/test/baseline/opt-account-width.test index b961a90e..5b5f7d98 100644 --- a/test/baseline/opt-account-width.test +++ b/test/baseline/opt-account-width.test @@ -1,9 +1,9 @@ -reg --account-width=40 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --account-width=40 07-Feb-02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX Income:Dividends:Vanguard:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-account.test b/test/baseline/opt-account.test index 0479a5e5..b19cb1a7 100644 --- a/test/baseline/opt-account.test +++ b/test/baseline/opt-account.test @@ -1,9 +1,9 @@ -reg --account='payee + ":" + commodity' -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --account='payee + ":" + commodity' 07-Feb-02 RD VMMXX RD:VM:As:In:Vang:VMMXX 0.350 VMMXX 0.350 VMMXX 07-Feb-02 RD VMMXX RD:$:In:Di:Vangu:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-actual.test b/test/baseline/opt-actual.test index 9f7920d4..5e70efb0 100644 --- a/test/baseline/opt-actual.test +++ b/test/baseline/opt-actual.test @@ -1,5 +1,3 @@ -print --actual -<<< = Books Expenses:Taxes 0.05 Assets:Checking -0.05 @@ -7,7 +5,9 @@ print --actual 2008/01/01 January Expenses:Books $10.00 Assets:Cash $-10.00 ->>>1 + +test print --actual 2008/01/01 January Expenses:Books $10.00 Assets:Cash $-10.00 +end test diff --git a/test/baseline/opt-add-budget.test b/test/baseline/opt-add-budget.test index a8e06f3f..4e54a923 100644 --- a/test/baseline/opt-add-budget.test +++ b/test/baseline/opt-add-budget.test @@ -1,5 +1,3 @@ -reg --add-budget books cards --now=2009/12/31 -<<< ~ monthly Expenses:Books $10.00 Assets:Cash @@ -243,7 +241,8 @@ reg --add-budget books cards --now=2009/12/31 Expenses:Books $120.00 Liabilities:Cards $120.00 Assets:Cash ->>>1 + +test reg --add-budget books cards --now=2009/12/31 08-Jan-01 Budget transaction Expenses:Books $-10.00 $-10.00 08-Jan-01 January Expenses:Books $10.00 0 Liabilities:Cards $10.00 $10.00 @@ -364,3 +363,4 @@ reg --add-budget books cards --now=2009/12/31 Liabilities:Cards $120.00 $5760.00 09-Dec-31 End of December Expenses:Books $120.00 $5880.00 Liabilities:Cards $120.00 $6000.00 +end test diff --git a/test/baseline/opt-amount-data.test b/test/baseline/opt-amount-data.test index 10466510..ff91e7aa 100644 --- a/test/baseline/opt-amount-data.test +++ b/test/baseline/opt-amount-data.test @@ -1,8 +1,8 @@ -reg --amount-data -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --amount-data 2007-02-02 0.35 2007-02-02 -0.35 +end test diff --git a/test/baseline/opt-amount-width.test b/test/baseline/opt-amount-width.test index 454c0ae7..5c206923 100644 --- a/test/baseline/opt-amount-width.test +++ b/test/baseline/opt-amount-width.test @@ -1,9 +1,9 @@ -reg --amount-width=18 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --amount-width=18 07-Feb-02 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Dividen:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-amount.test b/test/baseline/opt-amount.test index 980f9052..9addd356 100644 --- a/test/baseline/opt-amount.test +++ b/test/baseline/opt-amount.test @@ -1,8 +1,8 @@ -reg --amount=10 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --amount=10 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 10 10 In:Divid:Vanguar:VMMXX 10 20 +end test diff --git a/test/baseline/opt-average.test b/test/baseline/opt-average.test index 7895c5f3..752bc4c4 100644 --- a/test/baseline/opt-average.test +++ b/test/baseline/opt-average.test @@ -1,5 +1,3 @@ -reg --average books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --average books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --average books 08-Jan-01 January Expenses:Books $10.00 $10.00 08-Jan-31 End of January Expenses:Books $10.00 $10.00 08-Feb-01 February Expenses:Books $20.00 $13.33 @@ -240,3 +239,4 @@ reg --average books 09-Nov-30 End of November Expenses:Books $110.00 $62.61 09-Dec-01 December Expenses:Books $120.00 $63.83 09-Dec-31 End of December Expenses:Books $120.00 $65.00 +end test diff --git a/test/baseline/opt-balance-format.test b/test/baseline/opt-balance-format.test index e05bbae7..5924f6d6 100644 --- a/test/baseline/opt-balance-format.test +++ b/test/baseline/opt-balance-format.test @@ -1,8 +1,8 @@ -bal --balance-format='%(account)\n' --no-total -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal --balance-format='%(account)\n' --no-total Assets:Investments:Vanguard:VMMXX Income:Dividends:Vanguard:VMMXX +end test diff --git a/test/baseline/opt-base.test b/test/baseline/opt-base.test index 6d82f035..060dee42 100644 --- a/test/baseline/opt-base.test +++ b/test/baseline/opt-base.test @@ -1,5 +1,3 @@ -bal --base -<<< i 2007/03/01 23:00:00 A o 2007/03/02 01:00:00 i 2007/03/11 23:00:00 B @@ -13,7 +11,8 @@ o 2007/03/12 01:00:00 Assets:Receivable $4,000.00 Income:Contracts -40h {$20} @ $100.00 Income:Gains $-3,200.00 ->>>1 + +test bal --base 7200s A $8,000.00 Assets:Receivable 7200s B @@ -25,3 +24,4 @@ o 2007/03/12 01:00:00 -------------------- $8,000.00 -273600s +end test diff --git a/test/baseline/opt-basis.test b/test/baseline/opt-basis.test index 4b4923e1..6ee3fc97 100644 --- a/test/baseline/opt-basis.test +++ b/test/baseline/opt-basis.test @@ -1,10 +1,10 @@ -bal --basis -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal --basis $0.35 Assets:Investments:Vanguard:VMMXX $-0.35 Income:Dividends:Vanguard:VMMXX -------------------- 0 +end test diff --git a/test/baseline/opt-begin.test b/test/baseline/opt-begin.test index c834f83c..5e1edeaf 100644 --- a/test/baseline/opt-begin.test +++ b/test/baseline/opt-begin.test @@ -1,5 +1,3 @@ -reg --begin=2009/02 -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --begin=2009/02 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --begin=2009/02 09-Feb-01 February Expenses:Books $20.00 $20.00 Assets:Cash $-20.00 0 09-Feb-28 End of February Expenses:Books $20.00 $20.00 @@ -236,3 +235,4 @@ reg --begin=2009/02 Assets:Cash $-120.00 0 09-Dec-31 End of December Expenses:Books $120.00 $120.00 Assets:Cash $-120.00 0 +end test diff --git a/test/baseline/opt-budget.test b/test/baseline/opt-budget.test index 4ab9b3a6..9223da2a 100644 --- a/test/baseline/opt-budget.test +++ b/test/baseline/opt-budget.test @@ -1,5 +1,3 @@ -reg --budget books --now=2009/12/31 -<<< ~ monthly Expenses:Books $10.00 Liabilities $10.00 @@ -244,7 +242,8 @@ reg --budget books --now=2009/12/31 Expenses:Books $120.00 Liabilities:Cards $120.00 Assets:Cash ->>>1 + +test reg --budget books --now=2009/12/31 08-Jan-01 Budget transaction Expenses:Books $-10.00 $-10.00 08-Jan-01 January Expenses:Books $10.00 0 08-Jan-31 End of January Expenses:Books $10.00 $10.00 @@ -317,3 +316,4 @@ reg --budget books --now=2009/12/31 09-Dec-01 Budget transaction Expenses:Books $-10.00 $2640.00 09-Dec-01 December Expenses:Books $120.00 $2760.00 09-Dec-31 End of December Expenses:Books $120.00 $2880.00 +end test diff --git a/test/baseline/opt-budget_only.test b/test/baseline/opt-budget_only.test index b052ed36..d8581581 100644 --- a/test/baseline/opt-budget_only.test +++ b/test/baseline/opt-budget_only.test @@ -1,5 +1,3 @@ -reg income --budget --now=2010/06/20 -<<< ~ Monthly since 2010/01/01 Expenses:Bills:Rent $873.00 Expenses:Household $200.00 @@ -13,10 +11,12 @@ reg income --budget --now=2010/06/20 2010/06/22 c897683b Expenses:Household $100.00 Assets:Bank:Checking ->>> + +test reg income --budget --now=2010/06/20 10-Jan-01 Budget transaction Income:Salary $2491.60 $2491.60 10-Feb-01 Budget transaction Income:Salary $2491.60 $4983.20 10-Mar-01 Budget transaction Income:Salary $2491.60 $7474.80 10-Apr-01 Budget transaction Income:Salary $2491.60 $9966.40 10-May-01 Budget transaction Income:Salary $2491.60 $12458.00 10-Jun-01 Budget transaction Income:Salary $2491.60 $14949.60 +end test diff --git a/test/baseline/opt-budget_range.test b/test/baseline/opt-budget_range.test index 7c8ee2d2..14c92fab 100644 --- a/test/baseline/opt-budget_range.test +++ b/test/baseline/opt-budget_range.test @@ -1,5 +1,3 @@ -reg --now=2010/02 --sort=date exp --budget -<<< ~ monthly Expenses:Food $100 Expenses:Movies $20 @@ -23,7 +21,8 @@ reg --now=2010/02 --sort=date exp --budget 2009/06/05 Grocery Expenses:Food $5 Assets:Cash ->>> + +test reg --now=2010/02 --sort=date exp --budget 09-Jan-01 Budget transaction Expenses:Food $-101 $-101 09-Jan-01 Budget transaction Expenses:Movies $-21 $-122 09-Jan-01 Budget transaction Expenses:Food $-103 $-225 @@ -109,3 +108,4 @@ reg --now=2010/02 --sort=date exp --budget 10-Feb-01 Budget transaction Expenses:Movies $-20 $-5041 10-Feb-01 Budget transaction Expenses:Food $-101 $-5142 10-Feb-01 Budget transaction Expenses:Movies $-21 $-5163 +end test diff --git a/test/baseline/opt-by-payee.test b/test/baseline/opt-by-payee.test index 7cf47e0b..6d66781a 100644 --- a/test/baseline/opt-by-payee.test +++ b/test/baseline/opt-by-payee.test @@ -1,5 +1,3 @@ -reg --by-payee not @End -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --by-payee not @End 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --by-payee not @End 08-Apr-01 April Assets:Cash $-80.00 $-80.00 Expenses:Books $80.00 0 08-Aug-01 August Assets:Cash $-160.00 $-160.00 @@ -216,3 +215,4 @@ reg --by-payee not @End Expenses:Books $200.00 0 08-Sep-01 September Assets:Cash $-180.00 $-180.00 Expenses:Books $180.00 0 +end test diff --git a/test/baseline/opt-cleared.test b/test/baseline/opt-cleared.test index 5df0eb05..24caa091 100644 --- a/test/baseline/opt-cleared.test +++ b/test/baseline/opt-cleared.test @@ -1,5 +1,3 @@ -reg --cleared -<<< 2008/01/01 * January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --cleared 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --cleared 08-Jan-01 January Expenses:Books $10.00 $10.00 Assets:Cash $-10.00 0 08-Feb-01 February Expenses:Books $20.00 $20.00 @@ -202,3 +201,4 @@ reg --cleared 08-Apr-30 End of April Expenses:Books $40.00 $80.00 08-May-01 May Assets:Cash $-50.00 $30.00 08-May-31 End of May Assets:Cash $-50.00 $-20.00 +end test diff --git a/test/baseline/opt-code-as-account.test b/test/baseline/opt-code-as-account.test index 6c30f74f..f7e91a18 100644 --- a/test/baseline/opt-code-as-account.test +++ b/test/baseline/opt-code-as-account.test @@ -1,5 +1,3 @@ -reg --account=code -<<< 2008/01/01 * (100) January Expenses:Books $10.00 Assets:Cash @@ -19,7 +17,8 @@ reg --account=code 2008/03/01 * March Expenses:Books $30.00 Assets:Cash ->>>1 + +test reg --account=code 08-Jan-01 January 100:Expenses:Books $10.00 $10.00 08-Jan-01 January 100:Assets:Cash $-10.00 0 08-Jan-31 End of January 101:Expenses:Books $10.00 $10.00 @@ -30,3 +29,4 @@ reg --account=code 08-Feb-28 End of February 103:Assets:Cash $-20.00 0 08-Mar-01 March Expenses:Books $30.00 $30.00 08-Mar-01 March Assets:Cash $-30.00 0 +end test diff --git a/test/baseline/opt-code-as-payee.test b/test/baseline/opt-code-as-payee.test index a6ad3e6c..588457d2 100644 --- a/test/baseline/opt-code-as-payee.test +++ b/test/baseline/opt-code-as-payee.test @@ -1,5 +1,3 @@ -reg --payee=code -<<< 2008/01/01 * (100) January Expenses:Books $10.00 Assets:Cash @@ -19,7 +17,8 @@ reg --payee=code 2008/03/01 * March Expenses:Books $30.00 Assets:Cash ->>>1 + +test reg --payee=code 08-Jan-01 100 Expenses:Books $10.00 $10.00 08-Jan-01 100 Assets:Cash $-10.00 0 08-Jan-31 101 Expenses:Books $10.00 $10.00 @@ -30,3 +29,4 @@ reg --payee=code 08-Feb-28 103 Assets:Cash $-20.00 0 08-Mar-01 March Expenses:Books $30.00 $30.00 08-Mar-01 March Assets:Cash $-30.00 0 +end test diff --git a/test/baseline/opt-collapse-if-zero.test b/test/baseline/opt-collapse-if-zero.test index 960fa9b9..5bf400da 100644 --- a/test/baseline/opt-collapse-if-zero.test +++ b/test/baseline/opt-collapse-if-zero.test @@ -1,5 +1,3 @@ -reg --collapse-if-zero -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX $0.35 Income:Dividends:Vanguard:VMMXX $-0.35 @@ -7,7 +5,9 @@ reg --collapse-if-zero 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --collapse-if-zero 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-collapse.test b/test/baseline/opt-collapse.test index ac8fc642..3048f0c9 100644 --- a/test/baseline/opt-collapse.test +++ b/test/baseline/opt-collapse.test @@ -1,11 +1,11 @@ -bal --collapse -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal --collapse 0.350 VMMXX Assets $-0.35 Income -------------------- $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-collapse_reg.test b/test/baseline/opt-collapse_reg.test index e5dd14ee..aed1de0f 100644 --- a/test/baseline/opt-collapse_reg.test +++ b/test/baseline/opt-collapse_reg.test @@ -1,5 +1,3 @@ -reg --collapse food -<<< 2009/10/01 Test Expenses:Food:Dining $10 Expenses:Food:Tips $1 @@ -34,7 +32,8 @@ reg --collapse food Expenses:Food:Dining $10 Expenses:Food:Tips $1 Assets:Cash ->>>1 + +test reg --collapse food 09-Oct-01 Test <Total> $11 $11 09-Oct-02 Test <Total> $11 $22 09-Oct-03 Test <Total> $11 $33 @@ -42,3 +41,4 @@ reg --collapse food 09-Oct-05 Test <Total> $11 $55 09-Oct-06 Test <Total> $11 $66 09-Oct-07 Test <Total> $11 $77 +end test diff --git a/test/baseline/opt-color.test b/test/baseline/opt-color.test index 7048fb06..a7d702bd 100644 --- a/test/baseline/opt-color.test +++ b/test/baseline/opt-color.test @@ -1,11 +1,11 @@ -bal --color --force-color -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal --color --force-color 0.350 VMMXX [34mAssets:Investments:Vanguard:VMMXX[0m [31m$-0.35[0m [34mIncome:Dividends:Vanguard:VMMXX[0m -------------------- [31m$-0.35[0m 0.350 VMMXX +end test diff --git a/test/baseline/opt-columns.test b/test/baseline/opt-columns.test index bf603766..812799d1 100644 --- a/test/baseline/opt-columns.test +++ b/test/baseline/opt-columns.test @@ -1,9 +1,9 @@ -reg --columns=100 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --columns=100 07-Feb-02 RD VMMXX Asse:Investment:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX Incom:Dividends:Vanguard:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-commodity-as-account.test b/test/baseline/opt-commodity-as-account.test index 5f493df7..9fd3b33c 100644 --- a/test/baseline/opt-commodity-as-account.test +++ b/test/baseline/opt-commodity-as-account.test @@ -1,9 +1,9 @@ -reg --account=commodity -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --account=commodity 07-Feb-02 RD VMMXX VM:As:Inv:Vangua:VMMXX 0.350 VMMXX 0.350 VMMXX 07-Feb-02 RD VMMXX $:In:Div:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-commodity-as-payee.test b/test/baseline/opt-commodity-as-payee.test index e97cedf6..90fb9905 100644 --- a/test/baseline/opt-commodity-as-payee.test +++ b/test/baseline/opt-commodity-as-payee.test @@ -1,9 +1,9 @@ -reg --payee=commodity -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --payee=commodity 07-Feb-02 VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX 07-Feb-02 $ In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-cost.test b/test/baseline/opt-cost.test index 6ed660a2..3078d330 100644 --- a/test/baseline/opt-cost.test +++ b/test/baseline/opt-cost.test @@ -1,10 +1,10 @@ -bal --cost -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal --cost $0.35 Assets:Investments:Vanguard:VMMXX $-0.35 Income:Dividends:Vanguard:VMMXX -------------------- 0 +end test diff --git a/test/baseline/opt-csv-format.test b/test/baseline/opt-csv-format.test index 19edaffb..09ccc935 100644 --- a/test/baseline/opt-csv-format.test +++ b/test/baseline/opt-csv-format.test @@ -1,8 +1,8 @@ -csv --csv-format='"%(date)"\n' -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test csv --csv-format='"%(date)"\n' "2007/02/02" "2007/02/02" +end test diff --git a/test/baseline/opt-current.test b/test/baseline/opt-current.test index 80a787f6..c169d445 100644 --- a/test/baseline/opt-current.test +++ b/test/baseline/opt-current.test @@ -1,5 +1,3 @@ -bal --current -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 @@ -7,9 +5,11 @@ bal --current 2700/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal --current 0.350 VMMXX Assets:Investments:Vanguard:VMMXX $-0.35 Income:Dividends:Vanguard:VMMXX -------------------- $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-daily.test b/test/baseline/opt-daily.test index cc1e1e21..d3a0c721 100644 --- a/test/baseline/opt-daily.test +++ b/test/baseline/opt-daily.test @@ -1,5 +1,3 @@ -reg --daily -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -47,8 +45,10 @@ reg --daily 2008/02/01 End of February Expenses:Books $20.00 Assets:Cash ->>>1 + +test reg --daily 08-Jan-01 - 08-Jan-01 Assets:Cash $-60.00 $-60.00 Expenses:Books $60.00 0 08-Feb-01 - 08-Feb-01 Assets:Cash $-120.00 $-120.00 Expenses:Books $120.00 0 +end test diff --git a/test/baseline/opt-date-format.test b/test/baseline/opt-date-format.test index 7e11dc76..f055d5b7 100644 --- a/test/baseline/opt-date-format.test +++ b/test/baseline/opt-date-format.test @@ -1,9 +1,9 @@ -reg --date-format='%Y' -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --date-format='%Y' 2007 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Dividen:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-date-width.test b/test/baseline/opt-date-width.test index e5206056..617698fe 100644 --- a/test/baseline/opt-date-width.test +++ b/test/baseline/opt-date-width.test @@ -1,9 +1,9 @@ -reg --date-width=20 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --date-width=20 07-Feb-02 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Dividen:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-depth.test b/test/baseline/opt-depth.test index 33e18912..b302d9b9 100644 --- a/test/baseline/opt-depth.test +++ b/test/baseline/opt-depth.test @@ -1,5 +1,3 @@ -bal --depth 1 -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -19,15 +17,16 @@ bal --depth 1 Income:One:Books $-10.00 Income:One:Two:Books $-10.00 Income:One:Two:Three:Books $-10.00 ->>>1 + +test bal --depth 1 $-10.00 Assets $40.00 Expenses $-30.00 Income -------------------- 0 -=== 0 -bal --depth 2 ->>>1 +end test + +test bal --depth 2 $-10.00 Assets:Cash $40.00 Expenses $10.00 Books @@ -35,9 +34,9 @@ bal --depth 2 $-30.00 Income:One -------------------- 0 -=== 0 -bal --depth 3 ->>>1 +end test + +test bal --depth 3 $-10.00 Assets:Cash $40.00 Expenses $10.00 Books @@ -49,9 +48,9 @@ bal --depth 3 $-20.00 Two -------------------- 0 -=== 0 -bal --depth 4 ->>>1 +end test + +test bal --depth 4 $-10.00 Assets:Cash $40.00 Expenses $10.00 Books @@ -67,9 +66,9 @@ bal --depth 4 $-10.00 Three -------------------- 0 -=== 0 -bal --depth 5 ->>>1 +end test + +test bal --depth 5 $-10.00 Assets:Cash $40.00 Expenses $10.00 Books @@ -85,3 +84,4 @@ bal --depth 5 $-10.00 Three:Books -------------------- 0 +end test diff --git a/test/baseline/opt-depth_flat.test b/test/baseline/opt-depth_flat.test index 522e9034..7ca3d7d5 100644 --- a/test/baseline/opt-depth_flat.test +++ b/test/baseline/opt-depth_flat.test @@ -1,5 +1,3 @@ -bal --depth 1 --flat -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -19,26 +17,27 @@ bal --depth 1 --flat Income:One:Books $-10.00 Income:One:Two:Books $-10.00 Income:One:Two:Three:Books $-10.00 ->>>1 -=== 0 -bal --depth 2 --flat ->>>1 + +test bal --depth 1 --flat +end test + +test bal --depth 2 --flat $-10.00 Assets:Cash $10.00 Expenses:Books -------------------- 0 -=== 0 -bal --depth 3 --flat ->>>1 +end test + +test bal --depth 3 --flat $-10.00 Assets:Cash $10.00 Expenses:Books $10.00 Expenses:One:Books $-10.00 Income:One:Books -------------------- 0 -=== 0 -bal --depth 4 --flat ->>>1 +end test + +test bal --depth 4 --flat $-10.00 Assets:Cash $10.00 Expenses:Books $10.00 Expenses:One:Books @@ -47,9 +46,9 @@ bal --depth 4 --flat $-10.00 Income:One:Two:Books -------------------- 0 -=== 0 -bal --depth 5 --flat ->>>1 +end test + +test bal --depth 5 --flat $-10.00 Assets:Cash $10.00 Expenses:Books $10.00 Expenses:One:Books @@ -60,3 +59,4 @@ bal --depth 5 --flat $-10.00 Income:One:Two:Three:Books -------------------- 0 +end test diff --git a/test/baseline/opt-deviation.test b/test/baseline/opt-deviation.test index 9227f0c3..df216b9c 100644 --- a/test/baseline/opt-deviation.test +++ b/test/baseline/opt-deviation.test @@ -1,5 +1,3 @@ -reg --deviation books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --deviation books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --deviation books 08-Jan-01 January Expenses:Books $10.00 0 08-Jan-31 End of January Expenses:Books $10.00 0 08-Feb-01 February Expenses:Books $20.00 $6.67 @@ -240,3 +239,4 @@ reg --deviation books 09-Nov-30 End of November Expenses:Books $110.00 $47.39 09-Dec-01 December Expenses:Books $120.00 $56.17 09-Dec-31 End of December Expenses:Books $120.00 $55.00 +end test diff --git a/test/baseline/opt-display-amount.test b/test/baseline/opt-display-amount.test index e70fca29..3111c2ee 100644 --- a/test/baseline/opt-display-amount.test +++ b/test/baseline/opt-display-amount.test @@ -1,5 +1,3 @@ -reg --display-amount='amount * 10' books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -48,7 +46,8 @@ reg --display-amount='amount * 10' books Expenses:Books $20.00 Assets:Cash ->>>1 + +test reg --display-amount='amount * 10' books 08-Jan-01 January Expenses:Books $100.00 $10.00 08-Jan-01 End of January Expenses:Books $100.00 $20.00 08-Jan-01 January Expenses:Books $100.00 $30.00 @@ -61,3 +60,4 @@ reg --display-amount='amount * 10' books 08-Feb-01 End of February Expenses:Books $200.00 $140.00 08-Feb-01 February Expenses:Books $200.00 $160.00 08-Feb-01 End of February Expenses:Books $200.00 $180.00 +end test diff --git a/test/baseline/opt-display-total.test b/test/baseline/opt-display-total.test index a78dfad8..ae284f0c 100644 --- a/test/baseline/opt-display-total.test +++ b/test/baseline/opt-display-total.test @@ -1,5 +1,3 @@ -reg --display-total='amount * 10' books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -48,7 +46,8 @@ reg --display-total='amount * 10' books Expenses:Books $20.00 Assets:Cash ->>>1 + +test reg --display-total='amount * 10' books 08-Jan-01 January Expenses:Books $10.00 $100.00 08-Jan-01 End of January Expenses:Books $10.00 $100.00 08-Jan-01 January Expenses:Books $10.00 $100.00 @@ -61,3 +60,4 @@ reg --display-total='amount * 10' books 08-Feb-01 End of February Expenses:Books $20.00 $200.00 08-Feb-01 February Expenses:Books $20.00 $200.00 08-Feb-01 End of February Expenses:Books $20.00 $200.00 +end test diff --git a/test/baseline/opt-display.test b/test/baseline/opt-display.test index 3471bd94..8eee2aef 100644 --- a/test/baseline/opt-display.test +++ b/test/baseline/opt-display.test @@ -1,5 +1,3 @@ -reg --display='payee =~ /February/' books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -48,10 +46,12 @@ reg --display='payee =~ /February/' books Expenses:Books $20.00 Assets:Cash ->>>1 + +test reg --display='payee =~ /February/' books 08-Feb-01 February Expenses:Books $20.00 $80.00 08-Feb-01 End of February Expenses:Books $20.00 $100.00 08-Feb-01 February Expenses:Books $20.00 $120.00 08-Feb-01 End of February Expenses:Books $20.00 $140.00 08-Feb-01 February Expenses:Books $20.00 $160.00 08-Feb-01 End of February Expenses:Books $20.00 $180.00 +end test diff --git a/test/baseline/opt-dow.test b/test/baseline/opt-dow.test index da35067e..20116bb2 100644 --- a/test/baseline/opt-dow.test +++ b/test/baseline/opt-dow.test @@ -1,5 +1,3 @@ -reg --dow books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -48,6 +46,8 @@ reg --dow books Expenses:Books $20.00 Assets:Cash ->>>1 + +test reg --dow books 08-Jan-01 Tuesdays Expenses:Books $60.00 $60.00 08-Feb-01 Fridays Expenses:Books $120.00 $180.00 +end test diff --git a/test/baseline/opt-effective.test b/test/baseline/opt-effective.test index b5a7bba2..9d1e73d0 100644 --- a/test/baseline/opt-effective.test +++ b/test/baseline/opt-effective.test @@ -1,5 +1,3 @@ -reg --effective -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -11,10 +9,12 @@ reg --effective 2008/02/01 February Expenses:Books $20.00 Assets:Cash ->>>1 + +test reg --effective 08-Jan-01 January Expenses:Books $10.00 $10.00 Assets:Cash $-10.00 0 08-Feb-01 End of January Expenses:Books $10.00 $10.00 08-Jan-01 End of January Assets:Cash $-10.00 0 08-Feb-01 February Expenses:Books $20.00 $20.00 Assets:Cash $-20.00 0 +end test diff --git a/test/baseline/opt-empty.test b/test/baseline/opt-empty.test index 89dceaab..66ba100e 100644 --- a/test/baseline/opt-empty.test +++ b/test/baseline/opt-empty.test @@ -1,5 +1,3 @@ -reg --empty -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -19,7 +17,8 @@ reg --empty Income:One:Books $-10.00 Income:One:Two:Books $-10.00 Income:One:Two:Three:Books $-10.00 ->>>1 + +test reg --empty 08-Jan-01 January Expenses:Books $10.00 $10.00 Assets:Cash $-10.00 0 08-Jan-01 January Expenses:One:Books $10.00 $10.00 @@ -32,3 +31,4 @@ reg --empty Income:One:Books $-10.00 $20.00 Income:One:Two:Books $-10.00 $10.00 In:One:Two:Three:Books $-10.00 0 +end test diff --git a/test/baseline/opt-empty_bal.test b/test/baseline/opt-empty_bal.test index a35b46a2..20e9a65c 100644 --- a/test/baseline/opt-empty_bal.test +++ b/test/baseline/opt-empty_bal.test @@ -1,5 +1,3 @@ -bal --empty -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -19,7 +17,8 @@ bal --empty Income:One:Books $-10.00 Income:One:Two:Books $-10.00 Income:One:Two:Three:Books $-10.00 ->>>1 + +test bal --empty $-10.00 Assets:Cash $40.00 Expenses $10.00 Books @@ -37,3 +36,4 @@ bal --empty $-10.00 Three:Books -------------------- 0 +end test diff --git a/test/baseline/opt-empty_bal_flat.test b/test/baseline/opt-empty_bal_flat.test index 5171dad3..44b16138 100644 --- a/test/baseline/opt-empty_bal_flat.test +++ b/test/baseline/opt-empty_bal_flat.test @@ -1,5 +1,3 @@ -bal --empty --flat -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -19,7 +17,8 @@ bal --empty --flat Income:One:Books $-10.00 Income:One:Two:Books $-10.00 Income:One:Two:Three:Books $-10.00 ->>>1 + +test bal --empty --flat $-10.00 Assets:Cash $10.00 Expenses:Books $10.00 Expenses:One:Books @@ -31,3 +30,4 @@ bal --empty --flat $-10.00 Income:One:Two:Three:Books -------------------- 0 +end test diff --git a/test/baseline/opt-empty_collapse.test b/test/baseline/opt-empty_collapse.test index 1fb16850..1d645c01 100644 --- a/test/baseline/opt-empty_collapse.test +++ b/test/baseline/opt-empty_collapse.test @@ -1,5 +1,3 @@ -reg --empty --collapse -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -19,8 +17,10 @@ reg --empty --collapse Income:One:Books $-10.00 Income:One:Two:Books $-10.00 Income:One:Two:Three:Books $-10.00 ->>>1 + +test reg --empty --collapse 08-Jan-01 January <Total> 0 0 08-Jan-01 January <Total> 0 0 08-Jan-01 January <Total> 0 0 08-Jan-01 January <Total> 0 0 +end test diff --git a/test/baseline/opt-end.test b/test/baseline/opt-end.test index 74f072f5..8d79ea23 100644 --- a/test/baseline/opt-end.test +++ b/test/baseline/opt-end.test @@ -1,5 +1,3 @@ -reg --end=2009/02 -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --end=2009/02 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --end=2009/02 08-Jan-01 January Expenses:Books $10.00 $10.00 Assets:Cash $-10.00 0 08-Jan-31 End of January Expenses:Books $10.00 $10.00 @@ -244,3 +243,4 @@ reg --end=2009/02 Assets:Cash $-10.00 0 09-Jan-31 End of January Expenses:Books $10.00 $10.00 Assets:Cash $-10.00 0 +end test diff --git a/test/baseline/opt-equity.test b/test/baseline/opt-equity.test index a4bcc81c..d8695759 100644 --- a/test/baseline/opt-equity.test +++ b/test/baseline/opt-equity.test @@ -1,9 +1,9 @@ -equity assets -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test equity assets 2007/02/02 Opening Balances Assets:Investments:Vanguard:VMMXX 0.350 VMMXX Equity:Opening Balances -0.350 VMMXX +end test diff --git a/test/baseline/opt-exact.test b/test/baseline/opt-exact.test index c527d8df..c6efe46c 100644 --- a/test/baseline/opt-exact.test +++ b/test/baseline/opt-exact.test @@ -1,5 +1,3 @@ -reg --weekly --exact books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --weekly --exact books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --weekly --exact books 08-Jan-01 - 08-Jan-01 Expenses:Books $10.00 $10.00 08-Jan-31 - 08-Feb-01 Expenses:Books $30.00 $40.00 08-Feb-28 - 08-Mar-01 Expenses:Books $50.00 $90.00 @@ -221,3 +220,4 @@ reg --weekly --exact books 09-Nov-01 - 09-Nov-01 Expenses:Books $110.00 $2770.00 09-Nov-30 - 09-Dec-01 Expenses:Books $230.00 $3000.00 09-Dec-31 - 09-Dec-31 Expenses:Books $120.00 $3120.00 +end test diff --git a/test/baseline/opt-exchange.test b/test/baseline/opt-exchange.test index 357fc19d..cfc48c3f 100644 --- a/test/baseline/opt-exchange.test +++ b/test/baseline/opt-exchange.test @@ -1,5 +1,3 @@ -reg --exchange=' C, A ' -<<< 2009/01/01 January 1st, 2009 (1) Assets:Brokerage 100 A Assets:Brokerage -200 B @@ -47,7 +45,8 @@ reg --exchange=' C, A ' 2009/01/10 January 10th, 2009 Assets:Brokerage $2,000.00 Assets:Brokerage -155 A [2009/01/06] ->>>1 + +test reg --exchange=' C, A ' 09-Jan-01 January 1st, 2009 (1) Assets:Brokerage 100 A 100 A Assets:Brokerage -50 A 50 A 09-Jan-01 January 1st, 2009 (2) Assets:Brokerage 100 A 150 A @@ -77,3 +76,4 @@ reg --exchange=' C, A ' Assets:Brokerage -200 C -9871 C 09-Jan-10 January 10th, 2009 Assets:Brokerage 200 C -9671 C Assets:Brokerage -200 C -9871 C +end test diff --git a/test/baseline/opt-flat.test b/test/baseline/opt-flat.test index 80eb83c8..8fc4af44 100644 --- a/test/baseline/opt-flat.test +++ b/test/baseline/opt-flat.test @@ -1,5 +1,3 @@ -bal --flat -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -19,7 +17,8 @@ bal --flat Income:One:Books $-10.00 Income:One:Two:Books $-10.00 Income:One:Two:Three:Books $-10.00 ->>>1 + +test bal --flat $10.00 Expenses:Books $10.00 Expenses:One:Books $10.00 Expenses:One:Two:Books @@ -30,3 +29,4 @@ bal --flat $-10.00 Income:One:Two:Three:Books -------------------- 0 +end test diff --git a/test/baseline/opt-forecast-while.test b/test/baseline/opt-forecast-while.test index d58a8112..7262f42e 100644 --- a/test/baseline/opt-forecast-while.test +++ b/test/baseline/opt-forecast-while.test @@ -1,5 +1,3 @@ -reg --now=2009/03/21 --forecast-while='total < $3500' books -<<< ~ monthly Expenses:Books $10.00 Assets:Cash @@ -195,7 +193,8 @@ reg --now=2009/03/21 --forecast-while='total < $3500' books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --now=2009/03/21 --forecast-while='total < $3500' books 08-Jan-01 January Expenses:Books $10.00 $10.00 08-Jan-31 End of January Expenses:Books $10.00 $20.00 08-Feb-01 February Expenses:Books $20.00 $40.00 @@ -281,3 +280,4 @@ reg --now=2009/03/21 --forecast-while='total < $3500' books 12-Feb-01 Forecast transaction Expenses:Books $10.00 $3470.00 12-Mar-01 Forecast transaction Expenses:Books $10.00 $3480.00 12-Apr-01 Forecast transaction Expenses:Books $10.00 $3490.00 +end test diff --git a/test/baseline/opt-forecast_only.test b/test/baseline/opt-forecast_only.test index c63ab2a9..9adfa7a0 100644 --- a/test/baseline/opt-forecast_only.test +++ b/test/baseline/opt-forecast_only.test @@ -1,5 +1,3 @@ -reg --forecast 'date <[2011]' --now=2010/06/21 -<<< ~ Monthly since 2010/01/01 Expenses:Bills:Rent $873.00 Expenses:Household $200.00 @@ -9,7 +7,8 @@ reg --forecast 'date <[2011]' --now=2010/06/21 ~ biweekly from 2010/02/23 Expenses:Bills:Housecleaning $85.00 Assets:Bank:Checking ->>> + +test reg --forecast 'date <[2011]' --now=2010/06/21 10-Jul-01 Forecast transaction Expenses:Bills:Rent $873.00 $873.00 10-Jul-01 Forecast transaction Expenses:Household $200.00 $1073.00 10-Jul-01 Forecast transaction Income:Salary $-2491.60 $-1418.60 @@ -62,3 +61,4 @@ reg --forecast 'date <[2011]' --now=2010/06/21 10-Dec-12 Forecast transaction Assets:Bank:Checking $-85.00 0 10-Dec-26 Forecast transaction Exp:Bill:Housecleaning $85.00 $85.00 10-Dec-26 Forecast transaction Assets:Bank:Checking $-85.00 0 +end test diff --git a/test/baseline/opt-format.test b/test/baseline/opt-format.test index ccf57368..d3ba2b61 100644 --- a/test/baseline/opt-format.test +++ b/test/baseline/opt-format.test @@ -1,8 +1,8 @@ -reg --format='%(account) = %(strip(amount))\n' -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --format='%(account) = %(strip(amount))\n' Assets:Investments:Vanguard:VMMXX = 0.350 VMMXX Income:Dividends:Vanguard:VMMXX = $-0.35 +end test diff --git a/test/baseline/opt-gain.test b/test/baseline/opt-gain.test index 8735736d..4370a22e 100644 --- a/test/baseline/opt-gain.test +++ b/test/baseline/opt-gain.test @@ -1,5 +1,3 @@ -reg --gain stocks -<<< 2009/01/01 Sample 1a Assets:Brokerage:Stocks 100 S Assets:Brokerage:Cash -100 P @@ -48,7 +46,8 @@ P 2010/03/01 00:00:00 S 8 P Assets:Brokerage:Cash 100 P P 2010/04/01 00:00:00 S 16 P ->>>1 + +test reg --gain stocks 09-Jan-15 Commodities revalued <Revalued> 100 P 100 P 09-Feb-01 Commodities revalued <Revalued> 200 P 300 P 09-Feb-01 Sample 2a Asset:Brokerage:Stocks 300 P 600 P @@ -62,3 +61,4 @@ P 2010/04/01 00:00:00 S 16 P 10-Mar-01 Sample 3b Asset:Brokerage:Stocks 700 P 2800 P 10-Apr-01 Commodities revalued <Revalued> 3200 P 6000 P 10-Apr-01 Sample 4b Asset:Brokerage:Stocks -1500 P 4500 P +end test diff --git a/test/baseline/opt-head.test b/test/baseline/opt-head.test index eda22ded..d0f0368c 100644 --- a/test/baseline/opt-head.test +++ b/test/baseline/opt-head.test @@ -1,5 +1,3 @@ -reg --head=10 books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --head=10 books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --head=10 books 08-Jan-01 January Expenses:Books $10.00 $10.00 08-Jan-31 End of January Expenses:Books $10.00 $20.00 08-Feb-01 February Expenses:Books $20.00 $40.00 @@ -202,3 +201,4 @@ reg --head=10 books 08-Apr-30 End of April Expenses:Books $40.00 $200.00 08-May-01 May Expenses:Books $50.00 $250.00 08-May-31 End of May Expenses:Books $50.00 $300.00 +end test diff --git a/test/baseline/opt-input-date-format.test b/test/baseline/opt-input-date-format.test index 7385fe00..7569d612 100644 --- a/test/baseline/opt-input-date-format.test +++ b/test/baseline/opt-input-date-format.test @@ -1,9 +1,9 @@ -reg --input-date-format='%m%%%d%%%Y' -<<< 02%02%2007 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --input-date-format='%m%%%d%%%Y' 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-invert.test b/test/baseline/opt-invert.test index 4996400e..ed820748 100644 --- a/test/baseline/opt-invert.test +++ b/test/baseline/opt-invert.test @@ -1,9 +1,9 @@ -reg --invert -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --invert 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX -0.350 VMMXX -0.350 VMMXX In:Divid:Vanguar:VMMXX $0.35 $0.35 -0.350 VMMXX +end test diff --git a/test/baseline/opt-limit.test b/test/baseline/opt-limit.test index d4683f19..b7703c08 100644 --- a/test/baseline/opt-limit.test +++ b/test/baseline/opt-limit.test @@ -1,5 +1,3 @@ -reg --limit='account =~ /Books/ and amount < 50' -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --limit='account =~ /Books/ and amount < 50' 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --limit='account =~ /Books/ and amount < 50' 08-Jan-01 January Expenses:Books $10.00 $10.00 08-Jan-31 End of January Expenses:Books $10.00 $20.00 08-Feb-01 February Expenses:Books $20.00 $40.00 @@ -208,3 +207,4 @@ reg --limit='account =~ /Books/ and amount < 50' 09-Mar-31 End of March Expenses:Books $30.00 $320.00 09-Apr-01 April Expenses:Books $40.00 $360.00 09-Apr-30 End of April Expenses:Books $40.00 $400.00 +end test diff --git a/test/baseline/opt-lot-dates.test b/test/baseline/opt-lot-dates.test index 383fdb26..c07e96e8 100644 --- a/test/baseline/opt-lot-dates.test +++ b/test/baseline/opt-lot-dates.test @@ -1,5 +1,3 @@ -reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lot-dates -<<< C 1.00s = 100c C 1.00G = 100s @@ -550,7 +548,8 @@ D 1.00G 2006/04/01 Auction House Assets:Tajer:Items "Orb of Deception" 1 @ 155G Assets:Tajer ->>>1 + +test reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lot-dates 133.98G 158.85G 0 @@ -4594,3 +4593,4 @@ D 1.00G "Two of Portals" 2 [2006/03/19] "Wildheart Belt" -1 "Wildheart Belt" 1 [2006/03/17] +end test diff --git a/test/baseline/opt-lot-prices.test b/test/baseline/opt-lot-prices.test index db9b62aa..b23d5c67 100644 --- a/test/baseline/opt-lot-prices.test +++ b/test/baseline/opt-lot-prices.test @@ -1,5 +1,3 @@ -reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lot-prices -<<< C 1.00s = 100c C 1.00G = 100s @@ -550,7 +548,8 @@ D 1.00G 2006/04/01 Auction House Assets:Tajer:Items "Orb of Deception" 1 @ 155G Assets:Tajer ->>>1 + +test reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lot-prices 133.98G 158.85G 0 @@ -2148,3 +2147,4 @@ D 1.00G "Orb of Deception" 1 {155.00G} 35.42G "Orb of Deception" 1 {155.00G} +end test diff --git a/test/baseline/opt-lot-tags.test b/test/baseline/opt-lot-tags.test index fd05e72a..233c0f24 100644 --- a/test/baseline/opt-lot-tags.test +++ b/test/baseline/opt-lot-tags.test @@ -1,10 +1,10 @@ -bal --lot-tags tajer -<<< D 1.00c 2006/03/14 Opening Balances Assets:Tajer 1339829c (TAG) Assets:Gruulmorg 248720c Equity:Gold ->>>1 + +test bal --lot-tags tajer 1339829.00c (TAG) Assets:Tajer +end test diff --git a/test/baseline/opt-lots-actual.test b/test/baseline/opt-lots-actual.test index 7a19f7da..395b0eaf 100644 --- a/test/baseline/opt-lots-actual.test +++ b/test/baseline/opt-lots-actual.test @@ -1,22 +1,22 @@ -reg --format '%(justify(scrub(total_expr), 40, 40, true))\n' --lots -<<< D 1.0000s 2006/03/14 Opening Balances Assets:Tajer 1339829c @ 1.86590975416s Assets:Gruulmorg 248720c @ 10.051463493s Equity:Gold -5000000s ->>>1 + +test reg --format '%(justify(scrub(total_expr), 40, 40, true))\n' --lots 1339829c {1.86590975416s} [2006/03/14] 1339829c {1.86590975416s} [2006/03/14] 248720c {10.051463493s} [2006/03/14] 1339829c {1.86590975416s} [2006/03/14] 248720c {10.051463493s} [2006/03/14] -1388.89h -=== 0 -reg --format '%(justify(scrub(total_expr), 40, 40, true))\n' --lots-actual ->>>1 +end test + +test reg --format '%(justify(scrub(total_expr), 40, 40, true))\n' --lots-actual 1339829c 1588549c 1588549c -1388.89h +end test diff --git a/test/baseline/opt-lots.test b/test/baseline/opt-lots.test index 085cb8c8..bd47fb1e 100644 --- a/test/baseline/opt-lots.test +++ b/test/baseline/opt-lots.test @@ -1,5 +1,3 @@ -reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lots -<<< C 1.00s = 100c C 1.00G = 100s @@ -550,7 +548,8 @@ D 1.00G 2006/04/01 Auction House Assets:Tajer:Items "Orb of Deception" 1 @ 155G Assets:Tajer ->>>1 + +test reg -F '%(justify(scrub(total_expr), 80, 80, true))\n' --lots 133.98G 158.85G 0 @@ -5814,3 +5813,4 @@ D 1.00G "Two of Portals" -1 {3.00G} "Wildheart Belt" 1 {30.00G} [2006/03/17] "Wildheart Belt" -1 {30.00G} +end test diff --git a/test/baseline/opt-lots_basis.test b/test/baseline/opt-lots_basis.test index 72f4f772..62c49ee1 100644 --- a/test/baseline/opt-lots_basis.test +++ b/test/baseline/opt-lots_basis.test @@ -1,5 +1,3 @@ -reg --basis -<<< C 1.00s = 100c C 1.00G = 100s @@ -550,7 +548,8 @@ D 1.00G 2006/04/01 Auction House Assets:Tajer:Items "Orb of Deception" 1 @ 155G Assets:Tajer ->>>1 + +test reg --basis 06-Mar-14 Opening Balances Assets:Tajer 133.98G 133.98G Assets:Gruulmorg 24.87G 158.85G Equity:Gold -158.85G 0 @@ -892,3 +891,4 @@ D 1.00G Assets:Tajer -74.10G 0 06-Apr-01 Auction House Assets:Tajer:Items 155.00G 155.00G Assets:Tajer -155.00G 0 +end test diff --git a/test/baseline/opt-lots_basis_base.test b/test/baseline/opt-lots_basis_base.test index 241b3a64..5eecf8fa 100644 --- a/test/baseline/opt-lots_basis_base.test +++ b/test/baseline/opt-lots_basis_base.test @@ -1,5 +1,3 @@ -reg --basis --base -<<< C 1.00s = 100c C 1.00G = 100s @@ -551,7 +549,8 @@ D 1.00G Assets:Tajer:Items "Orb of Deception" 1 @ 155G Assets:Tajer ->>>1 + +test reg --basis --base 06-Mar-14 Opening Balances Assets:Tajer 1339829c 1339829c Assets:Gruulmorg 248720c 1588549c Equity:Gold -1588549c 0 @@ -893,3 +892,4 @@ D 1.00G Assets:Tajer -740990c 0 06-Apr-01 Auction House Assets:Tajer:Items 1550000c 1550000c Assets:Tajer -1550000c 0 +end test diff --git a/test/baseline/opt-market.test b/test/baseline/opt-market.test index 22359374..ee68d833 100644 --- a/test/baseline/opt-market.test +++ b/test/baseline/opt-market.test @@ -1,5 +1,3 @@ -reg --market stocks -<<< 2009/01/01 Sample 1a Assets:Brokerage:Stocks 100 S Assets:Brokerage:Cash -100 P @@ -48,7 +46,8 @@ P 2010/03/01 00:00:00 S 8 P Assets:Brokerage:Cash 100 P P 2010/04/01 00:00:00 S 16 P ->>>1 + +test reg --market stocks 09-Jan-01 Sample 1a Asset:Brokerage:Stocks 200 P 200 P 09-Feb-01 Commodities revalued <Revalued> 200 P 400 P 09-Feb-01 Sample 2a Asset:Brokerage:Stocks 400 P 800 P @@ -62,3 +61,4 @@ P 2010/04/01 00:00:00 S 16 P 10-Mar-01 Sample 3b Asset:Brokerage:Stocks 800 P 3200 P 10-Apr-01 Commodities revalued <Revalued> 3200 P 6400 P 10-Apr-01 Sample 4b Asset:Brokerage:Stocks -1600 P 4800 P +end test diff --git a/test/baseline/opt-master-account.test b/test/baseline/opt-master-account.test index 873db755..ca3f9b2a 100644 --- a/test/baseline/opt-master-account.test +++ b/test/baseline/opt-master-account.test @@ -1,9 +1,8 @@ -bal --master-account=Master -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal --master-account=Master $-0.35 0.350 VMMXX Master 0.350 VMMXX Assets:Investments:Vanguard:VMMXX @@ -11,3 +10,4 @@ bal --master-account=Master -------------------- $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-meta-width.test b/test/baseline/opt-meta-width.test index 51fd09cf..ce751e24 100644 --- a/test/baseline/opt-meta-width.test +++ b/test/baseline/opt-meta-width.test @@ -1,5 +1,3 @@ -reg --meta Sample --meta-width=15 -<<< 2004/05/27 (100) Credit card company ; This is an xact note! ; Sample: Value @@ -9,6 +7,8 @@ reg --meta Sample --meta-width=15 ; :MyTag: Assets:Bank:Checking ; :AnotherTag: ->>> + +test reg --meta Sample --meta-width=15 Another Value 04-May-27 Credit card com.. Liab:MasterCard $20.00 $20.00 Value As:Ban:Checking $-20.00 0 +end test diff --git a/test/baseline/opt-meta.test b/test/baseline/opt-meta.test index 85f53003..d7025b46 100644 --- a/test/baseline/opt-meta.test +++ b/test/baseline/opt-meta.test @@ -1,5 +1,3 @@ -reg --meta Sample -<<< 2004/05/27 (100) Credit card company ; This is an xact note! ; Sample: Value @@ -9,6 +7,8 @@ reg --meta Sample ; :MyTag: Assets:Bank:Checking ; :AnotherTag: ->>> + +test reg --meta Sample Another Value04-May-27 Credit card company Liabilities:MasterCard $20.00 $20.00 Value Assets:Bank:Checking $-20.00 0 +end test diff --git a/test/baseline/opt-monthly.test b/test/baseline/opt-monthly.test index b96ad4b7..0e020507 100644 --- a/test/baseline/opt-monthly.test +++ b/test/baseline/opt-monthly.test @@ -1,5 +1,3 @@ -reg --monthly books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --monthly books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --monthly books 08-Jan-01 - 08-Jan-31 Expenses:Books $20.00 $20.00 08-Feb-01 - 08-Feb-29 Expenses:Books $40.00 $60.00 08-Mar-01 - 08-Mar-31 Expenses:Books $60.00 $120.00 @@ -216,3 +215,4 @@ reg --monthly books 09-Oct-01 - 09-Oct-31 Expenses:Books $200.00 $2660.00 09-Nov-01 - 09-Nov-30 Expenses:Books $220.00 $2880.00 09-Dec-01 - 09-Dec-31 Expenses:Books $240.00 $3120.00 +end test diff --git a/test/baseline/opt-no-total.test b/test/baseline/opt-no-total.test index a1b21783..56de2424 100644 --- a/test/baseline/opt-no-total.test +++ b/test/baseline/opt-no-total.test @@ -1,8 +1,8 @@ -bal --no-total -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal --no-total 0.350 VMMXX Assets:Investments:Vanguard:VMMXX $-0.35 Income:Dividends:Vanguard:VMMXX +end test diff --git a/test/baseline/opt-now.test b/test/baseline/opt-now.test index c517a24c..f0309224 100644 --- a/test/baseline/opt-now.test +++ b/test/baseline/opt-now.test @@ -1,4 +1,4 @@ -eval today --now=2009/01/01 -<<< ->>> + +test eval today --now=2009/01/01 2009/01/01 +end test diff --git a/test/baseline/opt-only.test b/test/baseline/opt-only.test index fccb804d..fe566705 100644 --- a/test/baseline/opt-only.test +++ b/test/baseline/opt-only.test @@ -1,5 +1,3 @@ -reg books --monthly --limit='amount > $100' -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,14 +189,15 @@ reg books --monthly --limit='amount > $100' 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg books --monthly --limit='amount > $100' 08-Nov-01 - 08-Nov-30 Expenses:Books $220.00 $220.00 08-Dec-01 - 08-Dec-31 Expenses:Books $240.00 $460.00 09-Nov-01 - 09-Nov-30 Expenses:Books $220.00 $680.00 09-Dec-01 - 09-Dec-31 Expenses:Books $240.00 $920.00 -=== 0 -reg books --monthly --only='amount > $100' ->>>1 +end test + +test reg books --monthly --only='amount > $100' 08-Jun-01 - 08-Jun-30 Expenses:Books $120.00 $120.00 08-Jul-01 - 08-Jul-31 Expenses:Books $140.00 $260.00 08-Aug-01 - 08-Aug-31 Expenses:Books $160.00 $420.00 @@ -213,9 +212,9 @@ reg books --monthly --only='amount > $100' 09-Oct-01 - 09-Oct-31 Expenses:Books $200.00 $2060.00 09-Nov-01 - 09-Nov-30 Expenses:Books $220.00 $2280.00 09-Dec-01 - 09-Dec-31 Expenses:Books $240.00 $2520.00 -=== 0 -reg books --monthly --display='amount > $100' ->>>1 +end test + +test reg books --monthly --display='amount > $100' 08-Jun-01 - 08-Jun-30 Expenses:Books $120.00 $420.00 08-Jul-01 - 08-Jul-31 Expenses:Books $140.00 $560.00 08-Aug-01 - 08-Aug-31 Expenses:Books $160.00 $720.00 @@ -230,3 +229,4 @@ reg books --monthly --display='amount > $100' 09-Oct-01 - 09-Oct-31 Expenses:Books $200.00 $2660.00 09-Nov-01 - 09-Nov-30 Expenses:Books $220.00 $2880.00 09-Dec-01 - 09-Dec-31 Expenses:Books $240.00 $3120.00 +end test diff --git a/test/baseline/opt-output.test b/test/baseline/opt-output.test index effea22e..948d8f07 100644 --- a/test/baseline/opt-output.test +++ b/test/baseline/opt-output.test @@ -1,9 +1,10 @@ -reg --output=/dev/stderr -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>2 + +test reg --output=/dev/stderr +__ERROR__ 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-pager.test b/test/baseline/opt-pager.test index 44879cae..2d58da3e 100644 --- a/test/baseline/opt-pager.test +++ b/test/baseline/opt-pager.test @@ -1,9 +1,9 @@ -reg --pager=cat -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --pager=cat 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-payee-as-account.test b/test/baseline/opt-payee-as-account.test index f76150ba..113a395b 100644 --- a/test/baseline/opt-payee-as-account.test +++ b/test/baseline/opt-payee-as-account.test @@ -1,5 +1,3 @@ -reg --account=payee -<<< 2008/01/01 * (100) January Expenses:Books $10.00 Assets:Cash @@ -19,7 +17,8 @@ reg --account=payee 2008/03/01 * March Expenses:Books $30.00 Assets:Cash ->>>1 + +test reg --account=payee 08-Jan-01 January January:Expenses:Books $10.00 $10.00 08-Jan-01 January January:Assets:Cash $-10.00 0 08-Jan-31 End of January End of :Expenses:Books $10.00 $10.00 @@ -30,3 +29,4 @@ reg --account=payee 08-Feb-28 End of February End of Feb:Assets:Cash $-20.00 0 08-Mar-01 March March:Expenses:Books $30.00 $30.00 08-Mar-01 March March:Assets:Cash $-30.00 0 +end test diff --git a/test/baseline/opt-payee-width.test b/test/baseline/opt-payee-width.test index 34a03477..abaf4b2f 100644 --- a/test/baseline/opt-payee-width.test +++ b/test/baseline/opt-payee-width.test @@ -1,9 +1,9 @@ -reg --payee-width=40 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --payee-width=40 07-Feb-02 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Dividen:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-payee.test b/test/baseline/opt-payee.test index 19081a5f..446dd33c 100644 --- a/test/baseline/opt-payee.test +++ b/test/baseline/opt-payee.test @@ -1,9 +1,9 @@ -reg --payee='account_base + ":" + commodity' -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --payee='account_base + ":" + commodity' 07-Feb-02 VMMXX:VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX 07-Feb-02 VMMXX:$ In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-pending.test b/test/baseline/opt-pending.test index 76fa136f..ecbf8ce6 100644 --- a/test/baseline/opt-pending.test +++ b/test/baseline/opt-pending.test @@ -1,5 +1,3 @@ -reg --pending -<<< 2008/01/01 * January Expenses:Books $10.00 Assets:Cash @@ -191,8 +189,10 @@ reg --pending 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --pending 08-Feb-01 February Expenses:Books $20.00 $20.00 Assets:Cash $-20.00 0 08-May-01 May Assets:Cash $-50.00 $-50.00 08-May-31 End of May Assets:Cash $-50.00 $-100.00 +end test diff --git a/test/baseline/opt-percent.test b/test/baseline/opt-percent.test index 0817dbb4..f4a3e1d2 100644 --- a/test/baseline/opt-percent.test +++ b/test/baseline/opt-percent.test @@ -1,5 +1,3 @@ -bal --percent -<<< 2008/01/11 LIAT Expenses:Travel:Airfare $40.00 Liabilities:MasterCard @@ -83,10 +81,12 @@ bal --percent 2008/12/26 U.S. Department of State Expenses:Travel:Passport $127.00 Assets:Checking ->>>1 + +test bal --percent 100.00% Assets:Checking 100.00% Expenses:Travel 92.15% Airfare 3.13% Auto 4.72% Passport 100.00% Liabilities:MasterCard +end test diff --git a/test/baseline/opt-period.test b/test/baseline/opt-period.test index c471c5a2..7268bcce 100644 --- a/test/baseline/opt-period.test +++ b/test/baseline/opt-period.test @@ -1,5 +1,3 @@ -reg -p "january 2008" -<<< 2008/01/01 January Expenses:Books $10.00 Liabilities:Cards $10.00 @@ -239,37 +237,38 @@ reg -p "january 2008" Expenses:Books $120.00 Liabilities:Cards $120.00 Assets:Cash ->>>1 + +test reg -p "january 2008" 08-Jan-01 January Expenses:Books $10.00 $10.00 Liabilities:Cards $10.00 $20.00 Assets:Cash $-20.00 0 08-Jan-31 End of January Expenses:Books $10.00 $10.00 Liabilities:Cards $10.00 $20.00 Assets:Cash $-20.00 0 -=== 0 -reg -p "monthly january 2008" ->>>1 +end test + +test reg -p "monthly january 2008" 08-Jan-01 - 08-Jan-31 Assets:Cash $-40.00 $-40.00 Expenses:Books $20.00 $-20.00 Liabilities:Cards $20.00 0 -=== 0 -reg -p "weekly january 2008" ->>>1 +end test + +test reg -p "weekly january 2008" 08-Jan-01 - 08-Jan-05 Assets:Cash $-20.00 $-20.00 Expenses:Books $10.00 $-10.00 Liabilities:Cards $10.00 0 08-Jan-29 - 08-Jan-31 Assets:Cash $-20.00 $-20.00 Expenses:Books $10.00 $-10.00 Liabilities:Cards $10.00 0 -=== 0 -reg -p "yearly 2008" ->>>1 +end test + +test reg -p "yearly 2008" 08-Jan-01 - 08-Dec-31 Assets:Cash $-3120.00 $-3120.00 Expenses:Books $1560.00 $-1560.00 Liabilities:Cards $1560.00 0 -=== 0 -reg -p "from 2009/11/01" ->>>1 +end test + +test reg -p "from 2009/11/01" 09-Nov-01 November Expenses:Books $110.00 $110.00 Liabilities:Cards $110.00 $220.00 Assets:Cash $-220.00 0 @@ -282,3 +281,4 @@ reg -p "from 2009/11/01" 09-Dec-31 End of December Expenses:Books $120.00 $120.00 Liabilities:Cards $120.00 $240.00 Assets:Cash $-240.00 0 +end test diff --git a/test/baseline/opt-plot-amount-format.test b/test/baseline/opt-plot-amount-format.test index 3146ebba..9c18a6d5 100644 --- a/test/baseline/opt-plot-amount-format.test +++ b/test/baseline/opt-plot-amount-format.test @@ -1,8 +1,8 @@ -reg -j --plot-amount-format='X %(format_date(date, "%Y-%m-%d")) Y %(quantity(scrub(display_amount)))\n' -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg -j --plot-amount-format='X %(format_date(date, "%Y-%m-%d")) Y %(quantity(scrub(display_amount)))\n' X 2007-02-02 Y 0.35 X 2007-02-02 Y -0.35 +end test diff --git a/test/baseline/opt-plot-total-format.test b/test/baseline/opt-plot-total-format.test index 5848f139..fe2870d1 100644 --- a/test/baseline/opt-plot-total-format.test +++ b/test/baseline/opt-plot-total-format.test @@ -1,8 +1,8 @@ -reg -J --plot-total-format='X %(format_date(date, "%Y-%m-%d")) Y %(quantity(scrub(display_amount)))\n' -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg -J --plot-total-format='X %(format_date(date, "%Y-%m-%d")) Y %(quantity(scrub(display_amount)))\n' X 2007-02-02 Y 0.35 X 2007-02-02 Y -0.35 +end test diff --git a/test/baseline/opt-prepend-format.test b/test/baseline/opt-prepend-format.test index 35b6e8d0..105930f1 100644 --- a/test/baseline/opt-prepend-format.test +++ b/test/baseline/opt-prepend-format.test @@ -1,17 +1,17 @@ -bal --prepend-format "%(account_base)" -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>> + +test bal --prepend-format "%(account_base)" VMMXX 0.350 VMMXX Assets:Investments:Vanguard:VMMXX VMMXX $-0.35 Income:Dividends:Vanguard:VMMXX -------------------- $-0.35 0.350 VMMXX -=== 0 -reg --prepend-format "%(account_base)" ->>> +end test + +test reg --prepend-format "%(account_base)" VMMXX07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX VMMXX In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-prepend-width.test b/test/baseline/opt-prepend-width.test index 488f737b..c20baeb4 100644 --- a/test/baseline/opt-prepend-width.test +++ b/test/baseline/opt-prepend-width.test @@ -1,17 +1,17 @@ -bal --prepend-format "%(account_base) " --prepend-width=10 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>> + +test bal --prepend-format "%(account_base) " --prepend-width=10 VMMXX 0.350 VMMXX Assets:Investments:Vanguard:VMMXX VMMXX $-0.35 Income:Dividends:Vanguard:VMMXX -------------------- $-0.35 0.350 VMMXX -=== 0 -reg --prepend-format "%(account_base) " --prepend-width=10 ->>> +end test + +test reg --prepend-format "%(account_base) " --prepend-width=10 VMMXX 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX VMMXX In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-price.test b/test/baseline/opt-price.test index 023cfbde..2ebd061e 100644 --- a/test/baseline/opt-price.test +++ b/test/baseline/opt-price.test @@ -1,5 +1,3 @@ -reg equities -<<< 2008/01/01 * Purchase Apple shares Equities 1000 AAPL @ $2 Cash $-2000 @@ -12,30 +10,32 @@ reg equities P 2008/10/01 02:18:02 AAPL $3 P 2009/01/31 02:18:02 AAPL $4 P 3000/01/01 02:18:02 APPL $100 ->>>1 + +test reg equities 08-Jan-01 Purchase Apple shares Equities 1000 AAPL 1000 AAPL 08-Jun-30 Sell some Apple sha.. Equities -500 AAPL 500 AAPL -=== 0 -reg -B equities ->>>1 +end test + +test reg -B equities 08-Jan-01 Purchase Apple shares Equities $2000 $2000 08-Jun-30 Sell some Apple sha.. Equities $-1250 $750 -=== 0 -reg --end 2009/06/26 -V equities ->>>1 +end test + +test reg --end 2009/06/26 -V equities 08-Jan-01 Purchase Apple shares Equities $2000 $2000 08-Jun-30 Commodities revalued <Revalued> $500 $2500 08-Jun-30 Sell some Apple sha.. Equities $-1250 $1250 09-Jan-31 Commodities revalued <Revalued> $250 $1500 09-Jun-26 Commodities revalued <Revalued> $500 $2000 -=== 0 -reg --end 2009/06/26 -G equities ->>>1 +end test + +test reg --end 2009/06/26 -G equities 08-Jun-30 Commodities revalued <Revalued> $500 $500 09-Jan-31 Commodities revalued <Revalued> $250 $750 09-Jun-26 Commodities revalued <Revalued> $500 $1250 -=== 0 -reg -I equities ->>>1 +end test + +test reg -I equities 08-Jan-01 Purchase Apple shares Equities $2000 $2000 08-Jun-30 Sell some Apple sha.. Equities $-1000 $1000 +end test diff --git a/test/baseline/opt-pricedb-format.test b/test/baseline/opt-pricedb-format.test index 14ee22b5..c5238fe9 100644 --- a/test/baseline/opt-pricedb-format.test +++ b/test/baseline/opt-pricedb-format.test @@ -1,5 +1,3 @@ -pricedb --pricedb-format='P %(date) %(scrub(display_amount))\n' -<<< D $1,000.00 P 2009/01/01 13:30:00 AAPL $10.00 @@ -11,9 +9,11 @@ P 2009/02/01 17:30:00 AAPL $50.00 2009/03/01 Purchase Assets:Brokerage 100 AAPL Income ->>>1 + +test pricedb --pricedb-format='P %(date) %(scrub(display_amount))\n' P 2009/01/01 $10.00 P 2009/01/01 $20.00 P 2009/01/01 $30.00 P 2009/01/01 $40.00 P 2009/02/01 $50.00 +end test diff --git a/test/baseline/opt-prices-format.test b/test/baseline/opt-prices-format.test index 6f70ad23..6c8c0191 100644 --- a/test/baseline/opt-prices-format.test +++ b/test/baseline/opt-prices-format.test @@ -1,5 +1,3 @@ -prices --prices-format='%(datetime) %(scrub(display_amount))\n' -<<< D $1,000.00 P 2009/01/01 13:30:00 AAPL $10.00 @@ -11,9 +9,11 @@ P 2009/02/01 17:30:00 AAPL $50.00 2009/03/01 Purchase Assets:Brokerage 100 AAPL Income ->>>1 + +test prices --prices-format='%(datetime) %(scrub(display_amount))\n' 2009/01/01 13:30:00 $10.00 2009/01/01 14:30:00 $20.00 2009/01/01 15:30:00 $30.00 2009/01/01 16:30:00 $40.00 2009/02/01 17:30:00 $50.00 +end test diff --git a/test/baseline/opt-quantity.test b/test/baseline/opt-quantity.test index ff023212..4b94c00f 100644 --- a/test/baseline/opt-quantity.test +++ b/test/baseline/opt-quantity.test @@ -1,9 +1,9 @@ -reg --quantity -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --quantity 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Divid:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-quarterly.test b/test/baseline/opt-quarterly.test index a602f0b6..e8856501 100644 --- a/test/baseline/opt-quarterly.test +++ b/test/baseline/opt-quarterly.test @@ -1,5 +1,3 @@ -reg --quarterly books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --quarterly books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --quarterly books 08-Jan-01 - 08-Mar-31 Expenses:Books $120.00 $120.00 08-Apr-01 - 08-Jun-30 Expenses:Books $300.00 $420.00 08-Jul-01 - 08-Sep-30 Expenses:Books $480.00 $900.00 @@ -200,3 +199,4 @@ reg --quarterly books 09-Apr-01 - 09-Jun-30 Expenses:Books $300.00 $1980.00 09-Jul-01 - 09-Sep-30 Expenses:Books $480.00 $2460.00 09-Oct-01 - 09-Dec-31 Expenses:Books $660.00 $3120.00 +end test diff --git a/test/baseline/opt-raw.test b/test/baseline/opt-raw.test index 751fda24..bbbd90b3 100644 --- a/test/baseline/opt-raw.test +++ b/test/baseline/opt-raw.test @@ -1,9 +1,9 @@ -print --raw -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test print --raw 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 +end test diff --git a/test/baseline/opt-real.test b/test/baseline/opt-real.test index d42889f3..0d5df660 100644 --- a/test/baseline/opt-real.test +++ b/test/baseline/opt-real.test @@ -1,9 +1,9 @@ -reg --real -<<< 2008/01/01 January Expenses:Books $10.00 (Liabilities:Cards) $10.00 Assets:Cash ->>>1 + +test reg --real 08-Jan-01 January Expenses:Books $10.00 $10.00 Assets:Cash $-10.00 0 +end test diff --git a/test/baseline/opt-register-format.test b/test/baseline/opt-register-format.test index a0a4850d..384accd8 100644 --- a/test/baseline/opt-register-format.test +++ b/test/baseline/opt-register-format.test @@ -1,8 +1,8 @@ -reg --register-format='%(amount)\n' -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --register-format='%(amount)\n' 0.350 VMMXX {$1.00} [2007/02/02] $-0.35 +end test diff --git a/test/baseline/opt-related-all.test b/test/baseline/opt-related-all.test index 1b316594..400fb01d 100644 --- a/test/baseline/opt-related-all.test +++ b/test/baseline/opt-related-all.test @@ -1,12 +1,12 @@ -reg --related-all credit -<<< 2009/06/18 This is a Test Expenses:Food $20.00 Expenses:Tips $2.00 Expenses:Tax $3.00 Liabilities:Credit ->>>1 + +test reg --related-all credit 09-Jun-18 This is a Test Expenses:Food $20.00 $20.00 Expenses:Tips $2.00 $22.00 Expenses:Tax $3.00 $25.00 Liabilities:Credit $-25.00 0 +end test diff --git a/test/baseline/opt-related.test b/test/baseline/opt-related.test index 45f709e3..f9d1ea37 100644 --- a/test/baseline/opt-related.test +++ b/test/baseline/opt-related.test @@ -1,11 +1,11 @@ -reg --related credit -<<< 2009/06/18 This is a Test Expenses:Food $20.00 Expenses:Tips $2.00 Expenses:Tax $3.00 Liabilities:Credit ->>>1 + +test reg --related credit 09-Jun-18 This is a Test Expenses:Food $20.00 $20.00 Expenses:Tips $2.00 $22.00 Expenses:Tax $3.00 $25.00 +end test diff --git a/test/baseline/opt-revalued-only.test b/test/baseline/opt-revalued-only.test index ad090adb..5ed9191c 100644 --- a/test/baseline/opt-revalued-only.test +++ b/test/baseline/opt-revalued-only.test @@ -1,5 +1,3 @@ -reg --market --revalued-only stocks -<<< 2009/01/01 Sample 1a Assets:Brokerage:Stocks 100 S Assets:Brokerage:Cash -100 P @@ -48,10 +46,12 @@ P 2010/03/01 00:00:00 S 8 P Assets:Brokerage:Cash 100 P P 2010/04/01 00:00:00 S 16 P ->>>1 + +test reg --market --revalued-only stocks 09-Feb-01 Commodities revalued <Revalued> 200 P 400 P 09-Mar-01 Commodities revalued <Revalued> 800 P 1600 P 09-Apr-01 Commodities revalued <Revalued> 2400 P 4800 P 10-Feb-01 Commodities revalued <Revalued> -2400 P 800 P 10-Mar-01 Commodities revalued <Revalued> 1200 P 2400 P 10-Apr-01 Commodities revalued <Revalued> 3200 P 6400 P +end test diff --git a/test/baseline/opt-revalued.test b/test/baseline/opt-revalued.test index 8a27976b..847e8b86 100644 --- a/test/baseline/opt-revalued.test +++ b/test/baseline/opt-revalued.test @@ -1,5 +1,3 @@ -reg --market --revalued stocks -<<< 2009/01/01 Sample 1a Assets:Brokerage:Stocks 100 S Assets:Brokerage:Cash -100 P @@ -48,7 +46,8 @@ P 2010/03/01 00:00:00 S 8 P Assets:Brokerage:Cash 100 P P 2010/04/01 00:00:00 S 16 P ->>>1 + +test reg --market --revalued stocks 09-Jan-01 Sample 1a Asset:Brokerage:Stocks 200 P 200 P 09-Feb-01 Commodities revalued <Revalued> 200 P 400 P 09-Feb-01 Sample 2a Asset:Brokerage:Stocks 400 P 800 P @@ -62,3 +61,4 @@ P 2010/04/01 00:00:00 S 16 P 10-Mar-01 Sample 3b Asset:Brokerage:Stocks 800 P 3200 P 10-Apr-01 Commodities revalued <Revalued> 3200 P 6400 P 10-Apr-01 Sample 4b Asset:Brokerage:Stocks -1600 P 4800 P +end test diff --git a/test/baseline/opt-sort-all.test b/test/baseline/opt-sort-all.test index 73fc4025..e31d1cfc 100644 --- a/test/baseline/opt-sort-all.test +++ b/test/baseline/opt-sort-all.test @@ -1,5 +1,3 @@ -reg --monthly --sort=-amount -<<< 2008/01/11 LIAT Expenses:Travel:Airfare $40.00 Liabilities:MasterCard @@ -83,7 +81,8 @@ reg --monthly --sort=-amount 2008/12/26 U.S. Department of State Expenses:Travel:Passport $127.00 Assets:Checking ->>>1 + +test reg --monthly --sort=-amount 08-Jan-01 - 08-Jan-31 Expense:Travel:Airfare $222.19 $222.19 Liabilities:MasterCard $-222.19 0 08-Feb-01 - 08-Feb-29 Expense:Travel:Airfare $477.60 $477.60 @@ -99,9 +98,9 @@ reg --monthly --sort=-amount Liabilities:MasterCard $-3,925.94 0 08-Dec-01 - 08-Dec-31 Expens:Travel:Passport $254.00 $254.00 Assets:Checking $-254.00 0 -=== 0 -reg --monthly --sort-all=-amount ->>>1 +end test + +test reg --monthly --sort-all=-amount 08-Sep-01 - 08-Sep-30 Expense:Travel:Airfare $3,925.94 $3,925.94 08-Mar-01 - 08-Mar-31 Expense:Travel:Airfare $2,463.20 $6,389.14 08-Apr-01 - 08-Apr-30 Expense:Travel:Airfare $1,186.14 $7,575.28 @@ -117,3 +116,4 @@ reg --monthly --sort-all=-amount 08-Apr-01 - 08-Apr-30 Liabilities:MasterCard $-1,186.14 $6,389.14 08-Mar-01 - 08-Mar-31 Liabilities:MasterCard $-2,463.20 $3,925.94 08-Sep-01 - 08-Sep-30 Liabilities:MasterCard $-3,925.94 0 +end test diff --git a/test/baseline/opt-sort-xacts.test b/test/baseline/opt-sort-xacts.test index 403f10e2..5500e388 100644 --- a/test/baseline/opt-sort-xacts.test +++ b/test/baseline/opt-sort-xacts.test @@ -1,5 +1,3 @@ -reg --sort=account -<<< 2008/01/11 LIAT Expenses:Travel:Airfare $40.00 Liabilities:MasterCard @@ -83,7 +81,8 @@ reg --sort=account 2008/12/26 U.S. Department of State Expenses:Travel:Passport $127.00 Assets:Checking ->>>1 + +test reg --sort=account 08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-127.00 08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-254.00 08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $-214.00 @@ -126,9 +125,9 @@ reg --sort=account 08-Sep-22 DELTA Liabilities:MasterCard $-806.20 $1,224.54 08-Sep-22 DELTA Liabilities:MasterCard $-806.20 $418.34 08-Sep-22 LIAT 1974 LIMITED Liabilities:MasterCard $-418.34 0 -=== 0 -reg --sort-xacts=account ->>>1 +end test + +test reg --sort-xacts=account 08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $40.00 Liabilities:MasterCard $-40.00 0 08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $182.19 @@ -171,3 +170,4 @@ reg --sort-xacts=account Expens:Travel:Passport $127.00 0 08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-127.00 Expens:Travel:Passport $127.00 0 +end test diff --git a/test/baseline/opt-sort.test b/test/baseline/opt-sort.test index 1b7945cb..40e8116e 100644 --- a/test/baseline/opt-sort.test +++ b/test/baseline/opt-sort.test @@ -1,5 +1,3 @@ -reg airfare --sort=date -<<< 2008/01/11 LIAT Expenses:Travel:Airfare $40.00 Liabilities:MasterCard @@ -83,7 +81,8 @@ reg airfare --sort=date 2008/12/26 U.S. Department of State Expenses:Travel:Passport $127.00 Assets:Checking ->>>1 + +test reg airfare --sort=date 08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $40.00 08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $222.19 08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $460.99 @@ -100,9 +99,9 @@ reg airfare --sort=date 08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,050.53 08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,856.73 08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $8,275.07 -=== 0 -reg airfare --sort=date,amount ->>>1 +end test + +test reg airfare --sort=date,amount 08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $40.00 08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $222.19 08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $460.99 @@ -119,9 +118,9 @@ reg airfare --sort=date,amount 08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $6,662.67 08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,468.87 08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $8,275.07 -=== 0 -reg airfare --sort=date,-amount ->>>1 +end test + +test reg airfare --sort=date,-amount 08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $40.00 08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $222.19 08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $460.99 @@ -138,9 +137,9 @@ reg airfare --sort=date,-amount 08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,786.73 08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $8,205.07 08-Sep-22 AGNT FEE Expense:Travel:Airfare $70.00 $8,275.07 -=== 0 -reg airfare --sort=-date,-amount ->>>1 +end test + +test reg airfare --sort=-date,-amount 08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $806.20 08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $1,612.40 08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $2,030.74 @@ -157,9 +156,9 @@ reg airfare --sort=-date,-amount 08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $8,052.88 08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $8,235.07 08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $8,275.07 -=== 0 -bal --sort=total ->>>1 +end test + +test bal --sort=total $-8,726.04 Liabilities:MasterCard $-254.00 Assets:Checking $8,980.04 Expenses:Travel @@ -168,9 +167,9 @@ bal --sort=total $8,275.07 Airfare -------------------- 0 -=== 0 -bal --sort=-total ->>>1 +end test + +test bal --sort=-total $8,980.04 Expenses:Travel $8,275.07 Airfare $424.00 Passport @@ -179,9 +178,9 @@ bal --sort=-total $-8,726.04 Liabilities:MasterCard -------------------- 0 -=== 0 -bal --sort=-account ->>>1 +end test + +test bal --sort=-account $-8,726.04 Liabilities:MasterCard $8,980.04 Expenses:Travel $424.00 Passport @@ -190,9 +189,9 @@ bal --sort=-account $-254.00 Assets:Checking -------------------- 0 -=== 0 -reg --sort=account ->>>1 +end test + +test reg --sort=account 08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-127.00 08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-254.00 08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $-214.00 @@ -235,3 +234,4 @@ reg --sort=account 08-Sep-22 DELTA Liabilities:MasterCard $-806.20 $1,224.54 08-Sep-22 DELTA Liabilities:MasterCard $-806.20 $418.34 08-Sep-22 LIAT 1974 LIMITED Liabilities:MasterCard $-418.34 0 +end test diff --git a/test/baseline/opt-start-of-week.test b/test/baseline/opt-start-of-week.test index 39cd6a35..5c5382cb 100644 --- a/test/baseline/opt-start-of-week.test +++ b/test/baseline/opt-start-of-week.test @@ -1,5 +1,3 @@ -reg --weekly --start-of-week=mon books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --weekly --start-of-week=mon books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --weekly --start-of-week=mon books 07-Dec-31 - 08-Jan-06 Expenses:Books $10.00 $10.00 08-Jan-28 - 08-Feb-03 Expenses:Books $30.00 $40.00 08-Feb-25 - 08-Mar-02 Expenses:Books $50.00 $90.00 @@ -220,3 +219,4 @@ reg --weekly --start-of-week=mon books 09-Oct-26 - 09-Nov-01 Expenses:Books $210.00 $2770.00 09-Nov-30 - 09-Dec-06 Expenses:Books $230.00 $3000.00 09-Dec-28 - 10-Jan-03 Expenses:Books $120.00 $3120.00 +end test diff --git a/test/baseline/opt-strict.test b/test/baseline/opt-strict.test index 0a72af55..fea46b23 100644 --- a/test/baseline/opt-strict.test +++ b/test/baseline/opt-strict.test @@ -1,5 +1,3 @@ -reg --strict -<<< 2007/02/02 * Foo Expenses:Food $10.00 Assets:Cash @@ -11,12 +9,14 @@ reg --strict 2007/02/02 Baz Expenses:Foodx $30.00 Assets:Cash ->>>1 + +test reg --strict 07-Feb-02 Foo Expenses:Food $10.00 $10.00 Assets:Cash $-10.00 0 07-Feb-03 Bar Expenses:Food $20.00 $20.00 Assets:Cash $-20.00 0 07-Feb-02 Baz Expenses:Foodx $30.00 $30.00 Assets:Cash $-30.00 0 ->>>2 +__ERROR__ Warning: "$FILE", line 10: Unknown account 'Expenses:Foodx' +end test diff --git a/test/baseline/opt-subtotal.test b/test/baseline/opt-subtotal.test index f96fad2e..91410e48 100644 --- a/test/baseline/opt-subtotal.test +++ b/test/baseline/opt-subtotal.test @@ -1,5 +1,3 @@ -reg --subtotal -<<< 2008/01/11 LIAT Expenses:Travel:Airfare $40.00 Liabilities:MasterCard @@ -83,9 +81,11 @@ reg --subtotal 2008/12/26 U.S. Department of State Expenses:Travel:Passport $127.00 Assets:Checking ->>>1 + +test reg --subtotal 08-Jan-11 - 08-Dec-26 Assets:Checking $-254.00 $-254.00 Expense:Travel:Airfare $8,275.07 $8,021.07 Expenses:Travel:Auto $280.97 $8,302.04 Expens:Travel:Passport $424.00 $8,726.04 Liabilities:MasterCard $-8,726.04 0 +end test diff --git a/test/baseline/opt-tail.test b/test/baseline/opt-tail.test index 1b8f1410..4341347c 100644 --- a/test/baseline/opt-tail.test +++ b/test/baseline/opt-tail.test @@ -1,5 +1,3 @@ -reg --tail=10 books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --tail=10 books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --tail=10 books 09-Aug-01 August Expenses:Books $80.00 $2200.00 09-Aug-31 End of August Expenses:Books $80.00 $2280.00 09-Sep-01 September Expenses:Books $90.00 $2370.00 @@ -202,3 +201,4 @@ reg --tail=10 books 09-Nov-30 End of November Expenses:Books $110.00 $2880.00 09-Dec-01 December Expenses:Books $120.00 $3000.00 09-Dec-31 End of December Expenses:Books $120.00 $3120.00 +end test diff --git a/test/baseline/opt-total-data.test b/test/baseline/opt-total-data.test index 51c963b6..0a8a9c31 100644 --- a/test/baseline/opt-total-data.test +++ b/test/baseline/opt-total-data.test @@ -1,8 +1,8 @@ -reg --market --total-data -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --market --total-data 2007-02-02 0.35 2007-02-02 0 +end test diff --git a/test/baseline/opt-total-width.test b/test/baseline/opt-total-width.test index 3aec57d7..f9c197cb 100644 --- a/test/baseline/opt-total-width.test +++ b/test/baseline/opt-total-width.test @@ -1,9 +1,9 @@ -reg --total-width=25 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --total-width=25 07-Feb-02 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX In:Dividen:Vanguar:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-total.test b/test/baseline/opt-total.test index 6528b052..84cb3f66 100644 --- a/test/baseline/opt-total.test +++ b/test/baseline/opt-total.test @@ -1,8 +1,8 @@ -reg --total=10 -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --total=10 07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 10 In:Divid:Vanguar:VMMXX $-0.35 10 +end test diff --git a/test/baseline/opt-truncate.test b/test/baseline/opt-truncate.test index 459d6deb..fb4c6e17 100644 --- a/test/baseline/opt-truncate.test +++ b/test/baseline/opt-truncate.test @@ -1,5 +1,3 @@ -reg airfare --truncate=leading -<<< 2008/01/11 LIAT Expenses:Travel:Airfare $40.00 Liabilities:MasterCard @@ -83,7 +81,8 @@ reg airfare --truncate=leading 2008/12/26 U.S. Department of State Expenses:Travel:Passport $127.00 Assets:Checking ->>>1 + +test reg airfare --truncate=leading 08-Jan-11 LIAT ..enses:Travel:Airfare $40.00 $40.00 08-Jan-14 cheaptickets.com ..enses:Travel:Airfare $182.19 $222.19 08-Feb-05 UNITED ..enses:Travel:Airfare $238.80 $460.99 @@ -100,9 +99,9 @@ reg airfare --truncate=leading 08-Sep-22 DELTA ..enses:Travel:Airfare $806.20 $7,050.53 08-Sep-22 DELTA ..enses:Travel:Airfare $806.20 $7,856.73 08-Sep-22 LIAT 1974 LIMITED ..enses:Travel:Airfare $418.34 $8,275.07 -=== 0 -reg airfare --truncate=middle ->>>1 +end test + +test reg airfare --truncate=middle 08-Jan-11 LIAT Expenses:T..el:Airfare $40.00 $40.00 08-Jan-14 cheaptickets.com Expenses:T..el:Airfare $182.19 $222.19 08-Feb-05 UNITED Expenses:T..el:Airfare $238.80 $460.99 @@ -119,9 +118,9 @@ reg airfare --truncate=middle 08-Sep-22 DELTA Expenses:T..el:Airfare $806.20 $7,050.53 08-Sep-22 DELTA Expenses:T..el:Airfare $806.20 $7,856.73 08-Sep-22 LIAT 1974 LIMITED Expenses:T..el:Airfare $418.34 $8,275.07 -=== 0 -reg airfare --truncate=trailing ->>>1 +end test + +test reg airfare --truncate=trailing 08-Jan-11 LIAT Expenses:Travel:Airf.. $40.00 $40.00 08-Jan-14 cheaptickets.com Expenses:Travel:Airf.. $182.19 $222.19 08-Feb-05 UNITED Expenses:Travel:Airf.. $238.80 $460.99 @@ -138,3 +137,4 @@ reg airfare --truncate=trailing 08-Sep-22 DELTA Expenses:Travel:Airf.. $806.20 $7,050.53 08-Sep-22 DELTA Expenses:Travel:Airf.. $806.20 $7,856.73 08-Sep-22 LIAT 1974 LIMITED Expenses:Travel:Airf.. $418.34 $8,275.07 +end test diff --git a/test/baseline/opt-unbudgeted.test b/test/baseline/opt-unbudgeted.test index 56e01d58..227f33e6 100644 --- a/test/baseline/opt-unbudgeted.test +++ b/test/baseline/opt-unbudgeted.test @@ -1,5 +1,3 @@ -reg --unbudgeted -<<< ~ monthly Expenses:Books $10.00 Assets:Cash @@ -243,7 +241,8 @@ reg --unbudgeted Expenses:Books $120.00 Liabilities:Cards $120.00 Assets:Cash ->>>1 + +test reg --unbudgeted 08-Jan-01 January Liabilities:Cards $10.00 $10.00 08-Jan-31 End of January Liabilities:Cards $10.00 $20.00 08-Feb-01 February Liabilities:Cards $20.00 $40.00 @@ -292,3 +291,4 @@ reg --unbudgeted 09-Nov-30 End of November Liabilities:Cards $110.00 $2880.00 09-Dec-01 December Liabilities:Cards $120.00 $3000.00 09-Dec-31 End of December Liabilities:Cards $120.00 $3120.00 +end test diff --git a/test/baseline/opt-uncleared.test b/test/baseline/opt-uncleared.test index e80785c4..d82140d3 100644 --- a/test/baseline/opt-uncleared.test +++ b/test/baseline/opt-uncleared.test @@ -1,5 +1,3 @@ -reg --uncleared -<<< 2008/01/01 * January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --uncleared 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --uncleared 08-Jan-31 End of January Expenses:Books $10.00 $10.00 Assets:Cash $-10.00 0 08-Feb-01 February Expenses:Books $20.00 $20.00 @@ -282,3 +281,4 @@ reg --uncleared Assets:Cash $-120.00 $-80.00 09-Dec-31 End of December Expenses:Books $120.00 $40.00 Assets:Cash $-120.00 $-80.00 +end test diff --git a/test/baseline/opt-unrealized-gains.test b/test/baseline/opt-unrealized-gains.test index a6c0b698..a171a1bd 100644 --- a/test/baseline/opt-unrealized-gains.test +++ b/test/baseline/opt-unrealized-gains.test @@ -1,5 +1,3 @@ -bal -V --unrealized --unrealized-gains G -<<< 2008/10/01 Sample Assets:Brokerage 10 AAPL Assets:Checking $-200.00 @@ -9,10 +7,12 @@ P 2008/10/20 12:00:00 AAPL $30.00 ; 2008/10/20 <Generated Transaction> ; Assets:Brokerage $100 ; Equity:Unrealized Gains ->>>1 + +test bal -V --unrealized --unrealized-gains G $100.00 Assets $300.00 Brokerage $-200.00 Checking $-100.00 G -------------------- 0 +end test diff --git a/test/baseline/opt-unrealized-losses.test b/test/baseline/opt-unrealized-losses.test index 3b2c779a..5a460cbf 100644 --- a/test/baseline/opt-unrealized-losses.test +++ b/test/baseline/opt-unrealized-losses.test @@ -1,5 +1,3 @@ -bal -V --unrealized --unrealized-losses L -<<< 2008/10/01 Sample Assets:Brokerage 10 AAPL Assets:Checking $-200.00 @@ -9,10 +7,12 @@ P 2008/10/20 12:00:00 AAPL $10.00 ; 2008/10/20 <Generated Transaction> ; Assets:Brokerage $100 ; Equity:Unrealized Gains ->>>1 + +test bal -V --unrealized --unrealized-losses L $-100.00 Assets $100.00 Brokerage $-200.00 Checking $100.00 L -------------------- 0 +end test diff --git a/test/baseline/opt-unrealized.test b/test/baseline/opt-unrealized.test index a2a868f6..034eab9b 100644 --- a/test/baseline/opt-unrealized.test +++ b/test/baseline/opt-unrealized.test @@ -1,23 +1,3 @@ -bal -V --unrealized -<<< -2008/10/01 Sample - Assets:Brokerage 10 AAPL - Assets:Checking $-200.00 - -P 2008/10/20 12:00:00 AAPL $30.00 - -; 2008/10/20 <Generated Transaction> -; Assets:Brokerage $100 -; Equity:Unrealized Gains ->>>1 - $100.00 Assets - $300.00 Brokerage - $-200.00 Checking - $-100.00 Equity:Unrealized Gains --------------------- - 0 -bal -V --unrealized --now=2009/11/25 -<<< 2008/10/01 Sample Assets:Brokerage 10 AAPL Assets:Checking $-200.00 @@ -36,9 +16,11 @@ P 2008/10/20 12:00:00 QQQQ $110 ; 2008/10/20 <Generated Transaction> ; Assets:Brokerage $-100 ; Equity:Unrealized Losses ->>>1 + +test bal -V --unrealized 0 Assets $-800.00 Brokerage $800.00 Checking -------------------- 0 +end test diff --git a/test/baseline/opt-unround.test b/test/baseline/opt-unround.test index c6fcadd9..cef212ae 100644 --- a/test/baseline/opt-unround.test +++ b/test/baseline/opt-unround.test @@ -1,5 +1,3 @@ -bal --unround --percent -<<< 2008/01/11 LIAT Expenses:Travel:Airfare $40.00 Liabilities:MasterCard @@ -83,10 +81,12 @@ bal --unround --percent 2008/12/26 U.S. Department of State Expenses:Travel:Passport $127.00 Assets:Checking ->>>1 + +test bal --unround --percent 100.00% Assets:Checking 100.00% Expenses:Travel 92.14958953% Airfare 3.12882793% Auto 4.72158253% Passport 100.00% Liabilities:MasterCard +end test diff --git a/test/baseline/opt-weekly.test b/test/baseline/opt-weekly.test index 0506bdc8..38619b34 100644 --- a/test/baseline/opt-weekly.test +++ b/test/baseline/opt-weekly.test @@ -1,5 +1,3 @@ -reg --weekly books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --weekly books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --weekly books 07-Dec-30 - 08-Jan-05 Expenses:Books $10.00 $10.00 08-Jan-27 - 08-Feb-02 Expenses:Books $30.00 $40.00 08-Feb-24 - 08-Mar-01 Expenses:Books $50.00 $90.00 @@ -221,3 +220,4 @@ reg --weekly books 09-Nov-01 - 09-Nov-07 Expenses:Books $110.00 $2770.00 09-Nov-29 - 09-Dec-05 Expenses:Books $230.00 $3000.00 09-Dec-27 - 10-Jan-02 Expenses:Books $120.00 $3120.00 +end test diff --git a/test/baseline/opt-weekly_empty.test b/test/baseline/opt-weekly_empty.test index 1253f0a5..f5eabc97 100644 --- a/test/baseline/opt-weekly_empty.test +++ b/test/baseline/opt-weekly_empty.test @@ -1,5 +1,3 @@ -reg --weekly --empty books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,7 +189,8 @@ reg --weekly --empty books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --weekly --empty books 07-Dec-30 - 08-Jan-05 Expenses:Books $10.00 $10.00 08-Jan-06 - 08-Jan-12 <None> 0 $10.00 08-Jan-13 - 08-Jan-19 <None> 0 $10.00 @@ -297,3 +296,4 @@ reg --weekly --empty books 09-Dec-13 - 09-Dec-19 <None> 0 $3000.00 09-Dec-20 - 09-Dec-26 <None> 0 $3000.00 09-Dec-27 - 10-Jan-02 Expenses:Books $120.00 $3120.00 +end test diff --git a/test/baseline/opt-wide.test b/test/baseline/opt-wide.test index 484ae68b..4cdb15e6 100644 --- a/test/baseline/opt-wide.test +++ b/test/baseline/opt-wide.test @@ -1,9 +1,9 @@ -reg --wide -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test reg --wide 07-Feb-02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX Income:Dividends:Vanguard:VMMXX $-0.35 $-0.35 0.350 VMMXX +end test diff --git a/test/baseline/opt-yearly.test b/test/baseline/opt-yearly.test index b7976cd9..65b3341c 100644 --- a/test/baseline/opt-yearly.test +++ b/test/baseline/opt-yearly.test @@ -1,5 +1,3 @@ -reg --yearly books -<<< 2008/01/01 January Expenses:Books $10.00 Assets:Cash @@ -191,6 +189,8 @@ reg --yearly books 2009/12/31 End of December Expenses:Books $120.00 Assets:Cash ->>>1 + +test reg --yearly books 08-Jan-01 - 08-Dec-31 Expenses:Books $1560.00 $1560.00 09-Jan-01 - 09-Dec-31 Expenses:Books $1560.00 $3120.00 +end test diff --git a/test/baseline/test-sample.dat b/test/baseline/test-sample.dat deleted file mode 100644 index 4bfbe1e2..00000000 --- a/test/baseline/test-sample.dat +++ /dev/null @@ -1,91 +0,0 @@ -reg -<<< -; -*- ledger -*- - -N $ - -= /^Expenses:Books/ - (Liabilities:Taxes) -0.10 - -~ Monthly - Assets:Bank:Checking $500.00 - Income:Salary - -~ Yearly - Expenses:Donations $100.00 - Assets:Bank:Checking - -2004/05/01 * Checking balance - Assets:Bank:Checking $1,000.00 - Equity:Opening Balances - -2004/05/03=2004/05/01 * Investment balance - Assets:Brokerage 50 AAPL @ $30.00 - Equity:Opening Balances - -2004/05/14 * Páy dày - Assets:Bank:Checking 500.00€ - Income:Salary - -2004/05/14 * Another dày in which there is Páying - Asséts:Bánk:Chécking:Asséts:Bánk:Chécking $500.00 - Income:Salary - -2004/05/14 * Another dày in which there is Páying - Русский язык:Активы:Русский язык:Русский язык $1000.00 - Income:Salary - -tag foo - -2004/05/27 Book Store - Expenses:Books $20.00 - Expenses:Cards $40.00 - Expenses:Docs $30.00 - Liabilities:MasterCard - -end tag - -2004/05/27 (100) Credit card company - ; This is an xact note! - ; Sample: Value - Liabilities:MasterCard $20.00 - ; This is a posting note! - ; Sample: Another Value - ; :MyTag: - Assets:Bank:Checking - ; :AnotherTag: ->>>1 -04-May-01 Checking balance Assets:Bank:Checking $1,000.00 $1,000.00 - Eq:Opening Balances $-1,000.00 0 -04-May-03 Investment balance Assets:Brokerage 50 AAPL 50 AAPL - Eq:Opening Balances $-1,500.00 $-1,500.00 - 50 AAPL -04-May-14 Páy dày Assets:Bank:Checking 500.00€ $-1,500.00 - 50 AAPL - 500.00€ - Income:Salary -500.00€ $-1,500.00 - 50 AAPL -04-May-14 Another dày in whic.. ..Bá:Ch:As:Bá:Chécking $500.00 $-1,000.00 - 50 AAPL - Income:Salary $-500.00 $-1,500.00 - 50 AAPL -04-May-14 Another dày in whic.. Ру:Ак:Ру:Русский язык $1,000.00 $-500.00 - 50 AAPL - Income:Salary $-1,000.00 $-1,500.00 - 50 AAPL -04-May-27 Book Store Expenses:Books $20.00 $-1,480.00 - 50 AAPL - Expenses:Cards $40.00 $-1,440.00 - 50 AAPL - Expenses:Docs $30.00 $-1,410.00 - 50 AAPL - Liabilities:MasterCard $-90.00 $-1,500.00 - 50 AAPL - (Liabilities:Taxes) $-2.00 $-1,502.00 - 50 AAPL -04-May-27 Credit card company Liabilities:MasterCard $20.00 $-1,482.00 - 50 AAPL - Assets:Bank:Checking $-20.00 $-1,502.00 - 50 AAPL ->>>2 -=== 0 diff --git a/test/manual/transaction-codes-1.test b/test/manual/transaction-codes-1.test index fb8a4453..7a05b349 100644 --- a/test/manual/transaction-codes-1.test +++ b/test/manual/transaction-codes-1.test @@ -1,5 +1,3 @@ -reg --columns=60 food and code xfer -<<< 2009/10/29 (XFER) Panera Bread Expenses:Food $4.50 Assets:Checking @@ -15,6 +13,8 @@ reg --columns=60 food and code xfer 2009/10/31 (559385768438A8D7) Panera Bread Expenses:Food $4.50 Liabilities:Credit Card ->>>1 + +test reg --columns=60 food and code xfer 09-Oct-29 Panera Bread Expenses:Food $4.50 $4.50 09-Oct-30 Panera Bread Expenses:Food $4.50 $9.00 +end test diff --git a/test/manual/transaction-codes-2.test b/test/manual/transaction-codes-2.test index a949c394..911bc165 100644 --- a/test/manual/transaction-codes-2.test +++ b/test/manual/transaction-codes-2.test @@ -1,5 +1,3 @@ -bal checking --account=code -<<< 2009/10/29 (XFER) Panera Bread Expenses:Food $4.50 Assets:Checking @@ -15,8 +13,10 @@ bal checking --account=code 2009/10/31 (559385768438A8D7) Panera Bread Expenses:Food $4.50 Liabilities:Credit Card ->>>1 + +test bal checking --account=code $20.00 DEP:Assets:Checking $-9.00 XFER:Assets:Checking -------------------- $11.00 +end test diff --git a/test/manual/transaction-notes-1.test b/test/manual/transaction-notes-1.test index 528c2127..7c3d7200 100644 --- a/test/manual/transaction-notes-1.test +++ b/test/manual/transaction-notes-1.test @@ -1,5 +1,3 @@ -reg --columns=60 food and note eat -<<< 2009/11/01 Panera Bread ; Got something to eat Expenses:Food $4.50 Assets:Checking @@ -17,6 +15,8 @@ reg --columns=60 food and note eat ; This is another long note, after the metadata. Expenses:Food $4.50 Assets:Checking ->>>1 + +test reg --columns=60 food and note eat 09-Nov-01 Panera Bread Expenses:Food $4.50 $4.50 09-Nov-01 Panera Bread Expenses:Food $4.50 $9.00 +end test diff --git a/test/manual/transaction-notes-2.test b/test/manual/transaction-notes-2.test index 67dc15d9..603fcbe1 100644 --- a/test/manual/transaction-notes-2.test +++ b/test/manual/transaction-notes-2.test @@ -1,5 +1,3 @@ -reg --columns=60 food and tag eating -<<< 2009/11/01 Panera Bread ; Got something to eat Expenses:Food $4.50 Assets:Checking @@ -17,5 +15,7 @@ reg --columns=60 food and tag eating ; This is another long note, after the metadata. Expenses:Food $4.50 Assets:Checking ->>>1 + +test reg --columns=60 food and tag eating 09-Nov-01 Panera Bread Expenses:Food $4.50 $4.50 +end test diff --git a/test/manual/transaction-notes-3.test b/test/manual/transaction-notes-3.test index e598471d..9b05334c 100644 --- a/test/manual/transaction-notes-3.test +++ b/test/manual/transaction-notes-3.test @@ -1,5 +1,3 @@ -reg --columns=60 food and tag type=dining -<<< 2009/11/01 Panera Bread ; Got something to eat Expenses:Food $4.50 Assets:Checking @@ -17,5 +15,7 @@ reg --columns=60 food and tag type=dining ; This is another long note, after the metadata. Expenses:Food $4.50 Assets:Checking ->>>1 + +test reg --columns=60 food and tag type=dining 09-Nov-01 Panera Bread Expenses:Food $4.50 $4.50 +end test diff --git a/test/manual/transaction-notes-4.test b/test/manual/transaction-notes-4.test index b341d43e..071d5fa8 100644 --- a/test/manual/transaction-notes-4.test +++ b/test/manual/transaction-notes-4.test @@ -1,5 +1,3 @@ -bal food and tag type --account='"Tags:" + tag("Type")' -<<< 2009/11/01 Panera Bread ; Got something to eat Expenses:Food $4.50 Assets:Checking @@ -17,9 +15,11 @@ bal food and tag type --account='"Tags:" + tag("Type")' ; This is another long note, after the metadata. Expenses:Food $4.50 Assets:Checking ->>>1 + +test bal food and tag type --account='"Tags:" + tag("Type")' $9.00 Tags $4.50 Coffee:Expenses:Food $4.50 Dining:Expenses:Food -------------------- $9.00 +end test diff --git a/test/manual/transaction-status-1.test b/test/manual/transaction-status-1.test index 3c06bd6d..1f7ad095 100644 --- a/test/manual/transaction-status-1.test +++ b/test/manual/transaction-status-1.test @@ -1,5 +1,3 @@ -reg --columns=60 food -<<< 2009/10/31 * Panera Bread Expenses:Food $4.50 Assets @@ -11,7 +9,9 @@ reg --columns=60 food 2009/11/02 Panera Bread Expenses:Food $4.50 Assets ->>>1 + +test reg --columns=60 food 09-Oct-31 Panera Bread Expenses:Food $4.50 $4.50 09-Nov-01 Panera Bread Expenses:Food $4.50 $9.00 09-Nov-02 Panera Bread Expenses:Food $4.50 $13.50 +end test diff --git a/test/manual/transaction-status-2.test b/test/manual/transaction-status-2.test index e4033e64..6c6d4b8c 100644 --- a/test/manual/transaction-status-2.test +++ b/test/manual/transaction-status-2.test @@ -1,5 +1,3 @@ -reg --columns=60 food --cleared -<<< 2009/10/31 * Panera Bread Expenses:Food $4.50 Assets @@ -11,5 +9,7 @@ reg --columns=60 food --cleared 2009/11/02 Panera Bread Expenses:Food $4.50 Assets ->>>1 + +test reg --columns=60 food --cleared 09-Oct-31 Panera Bread Expenses:Food $4.50 $4.50 +end test diff --git a/test/manual/transaction-status-3.test b/test/manual/transaction-status-3.test index f4371693..f50ea23c 100644 --- a/test/manual/transaction-status-3.test +++ b/test/manual/transaction-status-3.test @@ -1,5 +1,3 @@ -reg --columns=60 food --uncleared -<<< 2009/10/31 * Panera Bread Expenses:Food $4.50 Assets @@ -11,6 +9,8 @@ reg --columns=60 food --uncleared 2009/11/02 Panera Bread Expenses:Food $4.50 Assets ->>>1 + +test reg --columns=60 food --uncleared 09-Nov-01 Panera Bread Expenses:Food $4.50 $4.50 09-Nov-02 Panera Bread Expenses:Food $4.50 $9.00 +end test diff --git a/test/manual/transaction-status-4.test b/test/manual/transaction-status-4.test index 24d07984..2ae03c3e 100644 --- a/test/manual/transaction-status-4.test +++ b/test/manual/transaction-status-4.test @@ -1,5 +1,3 @@ -reg --columns=60 food --pending -<<< 2009/10/31 * Panera Bread Expenses:Food $4.50 Assets @@ -11,5 +9,7 @@ reg --columns=60 food --pending 2009/11/02 Panera Bread Expenses:Food $4.50 Assets ->>>1 + +test reg --columns=60 food --pending 09-Nov-01 Panera Bread Expenses:Food $4.50 $4.50 +end test diff --git a/test/regress/04C5E1CA.test b/test/regress/04C5E1CA.test index c51234f0..1aeeb662 100644 --- a/test/regress/04C5E1CA.test +++ b/test/regress/04C5E1CA.test @@ -1,5 +1,3 @@ -reg -<<< 2009/04/04 CS Club Sign Expenses:School:CS Club:Home Depot:4" Brush 2 @ $3.97 Liabilities:Mastercard @@ -7,11 +5,12 @@ reg 2009/04/04 CS Club Sign Expenses:School:CS Club:Home Depot:4" Brush (2 * $3.97) Liabilities:Mastercard ->>>1 + +test reg 09-Apr-04 CS Club Sign Ex:Sc:CS:Home:4" Brush 2 2 Liabilities:Mastercard $-7.94 2 $-7.94 09-Apr-04 CS Club Sign Ex:Sc:CS:Home:4" Brush $7.94 2 Liabilities:Mastercard $-7.94 2 $-7.94 -=== 0 +end test diff --git a/test/regress/0CA014F9.test b/test/regress/0CA014F9.test index 1e736338..a736643c 100644 --- a/test/regress/0CA014F9.test +++ b/test/regress/0CA014F9.test @@ -1,11 +1,11 @@ -bal -<<< 2007/02/02 RD VMMXX Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 + +test bal 0.350 VMMXX Assets:Investments:Vanguard:VMMXX $-0.35 Income:Dividends:Vanguard:VMMXX -------------------- $-0.35 0.350 VMMXX +end test diff --git a/test/regress/13965214.test b/test/regress/13965214.test index 99dbc0fd..4fa9ce3a 100644 --- a/test/regress/13965214.test +++ b/test/regress/13965214.test @@ -1,5 +1,3 @@ -reg -<<< Y2008 01/30 A @@ -17,7 +15,8 @@ Y2008 03/01 D Bank 160 Income ->>>1 + +test reg 08-Jan-30 A Bank 130 130 Income -130 0 08-Feb-01 B Bank 140 140 @@ -26,3 +25,4 @@ Y2008 Income -150 0 08-Mar-01 D Bank 160 160 Income -160 0 +end test diff --git a/test/regress/15230B79.test b/test/regress/15230B79.test index b20ab89a..796c79b5 100644 --- a/test/regress/15230B79.test +++ b/test/regress/15230B79.test @@ -1,12 +1,12 @@ -reg -<<< 2010-04-02 Opening balance Assets:A 14.75 EUR Assets:B 2.84 GBP Equity:Opening balance ->>> + +test reg 10-Apr-02 Opening balance Assets:A 14.75 EUR 14.75 EUR Assets:B 2.84 GBP 14.75 EUR 2.84 GBP Equity:Opening balance -14.75 EUR 2.84 GBP Equity:Opening balance -2.84 GBP 0 +end test diff --git a/test/regress/1CF1EEC2.test b/test/regress/1CF1EEC2.test index 8deb4a5e..e1d0a99e 100644 --- a/test/regress/1CF1EEC2.test +++ b/test/regress/1CF1EEC2.test @@ -1,5 +1,3 @@ -equity assets -<<< 2009/01/01 sample Assets:Super:ARF $1000.00 Assets:Super:CSS $1000.00 @@ -17,9 +15,11 @@ equity assets Assets:Super:CSS $1000.00 Assets:Super:CSS:Contributions $1000.00 Income:Opening Balances ->>>1 + +test equity assets 2009/03/01 Opening Balances Assets:Super:ARF $3000.00 Assets:Super:CSS $3000.00 Assets:Super:CSS:Contributions $3000.00 Equity:Opening Balances $-9000.00 +end test diff --git a/test/regress/1D275740.test b/test/regress/1D275740.test index 0a1f650a..70a8092f 100644 --- a/test/regress/1D275740.test +++ b/test/regress/1D275740.test @@ -1,5 +1,3 @@ -print -<<< D 1.200,40 € 1999/11/01 * Achat @@ -87,7 +85,8 @@ D 1.200,40 € 2009/09/29 Vente Actif:SV -0,0415 MFE @ 358,800 € Actif:SV 14,89 € ->>>1 + +test print 1999/11/01 * Achat Actif:SSB 125,0000 STK Actif:SSB -1672,42 $ @@ -173,3 +172,4 @@ D 1.200,40 € 2009/09/29 Vente Actif:SV -0,0415 MFE @ 358,80 € Actif:SV 14,89 € +end test diff --git a/test/regress/25A099C9.test b/test/regress/25A099C9.test index b3e23a6c..fc06449b 100644 --- a/test/regress/25A099C9.test +++ b/test/regress/25A099C9.test @@ -1,7 +1,5 @@ --f $sourcepath/src/amount.h reg -<<< ->>>1 ->>>2 +test -f $sourcepath/src/amount.h reg -> 7 +__ERROR__ While parsing file "$sourcepath/src/amount.h", line 66: Error: No quantity specified for amount While parsing file "$sourcepath/src/amount.h", line 726: @@ -16,4 +14,4 @@ While parsing file "$sourcepath/src/amount.h", line 750: Error: Invalid date/time: line std::ostream& While parsing file "$sourcepath/src/amount.h", line 757: Error: Invalid date/time: line std::istream& -=== 7 +end test diff --git a/test/regress/2E3496BD.test b/test/regress/2E3496BD.test index 466464b3..82c7cde7 100644 --- a/test/regress/2E3496BD.test +++ b/test/regress/2E3496BD.test @@ -1,12 +1,11 @@ -bal -<<< D 1,000.00 USD 2007-12-31 * Start of year / Opening balances. Account1 1000 EUR @ 1.6 USD Account2 -1000 EUR @ 1.5 USD ->>>1 ->>>2 + +test bal -> 1 +__ERROR__ While parsing file "$FILE", line 5: While balancing transaction from "$FILE", lines 3-5: > 2007-12-31 * Start of year / Opening balances. @@ -17,4 +16,4 @@ Unbalanced remainder is: Amount to balance against: 1,600.00 USD Error: Transaction does not balance -=== 1 +end test diff --git a/test/regress/373540CC.test b/test/regress/373540CC.test index ad5c9a07..f4c2d504 100644 --- a/test/regress/373540CC.test +++ b/test/regress/373540CC.test @@ -1,7 +1,7 @@ -bal --sort total --flat -X '$' not '(Income|Liabilities)' -<<< 2004/05/27 Book Store Expenses:Books 20 BOOK @ $10 Liabilities:MasterCard $-200.00 ->>>1 + +test bal --sort total --flat -X '$' not '(Income|Liabilities)' $200.00 Expenses:Books +end test diff --git a/test/regress/3AB70168.test b/test/regress/3AB70168.test index 1fde2bdb..d4167307 100644 --- a/test/regress/3AB70168.test +++ b/test/regress/3AB70168.test @@ -1,11 +1,11 @@ -bal -<<< i 2007/03/01 23:00:00 A o 2007/03/02 01:00:00 i 2007/03/11 23:00:00 B o 2007/03/12 01:00:00 ->>>1 + +test bal 2.00h A 2.00h B -------------------- 4.00h +end test diff --git a/test/regress/461980A1.test b/test/regress/461980A1.test index 7c5da8e6..48f69d1e 100644 --- a/test/regress/461980A1.test +++ b/test/regress/461980A1.test @@ -1,11 +1,11 @@ -bal -<<< 2008/01/01 one test:a 1 test:b ->>>1 + +test bal 0 test 1 a -1 b -------------------- 0 +end test diff --git a/test/regress/55831A79.test b/test/regress/55831A79.test index a605a028..a1708934 100644 --- a/test/regress/55831A79.test +++ b/test/regress/55831A79.test @@ -1,5 +1,3 @@ -bal discover -<<< 2008/01/01 * previous balances liabilities:credit cards:discover 4462 $-1094.38 equity:opening balances @@ -16,9 +14,11 @@ bal discover 2008/03/01 * discover card payment liabilities:credit cards:discover 4462 $1198.14 assets:bank:wells fargo:checking ->>>1 + +test bal discover 0 liabilities:credit cards:discover 4462 $-39.00 fee $-64.76 interest -------------------- 0 +end test diff --git a/test/regress/56BBE69B.test b/test/regress/56BBE69B.test index 508ff8aa..69d3ca34 100644 --- a/test/regress/56BBE69B.test +++ b/test/regress/56BBE69B.test @@ -1,5 +1,3 @@ -bal -<<< D 1000.00 USD 2010-01-07 * Put money in @@ -9,9 +7,11 @@ D 1000.00 USD 2010-01-11 * Purchase Assets:A 20.00 EUR @@ 25.00 USD Expenses:B ->>> + +test bal 20.00 EUR Equity:Opening balances -25.00 USD Expenses:B -------------------- 20.00 EUR -25.00 USD +end test diff --git a/test/regress/5A03CFC3.test b/test/regress/5A03CFC3.test index 93c15cb2..d57277ca 100644 --- a/test/regress/5A03CFC3.test +++ b/test/regress/5A03CFC3.test @@ -1,5 +1,3 @@ -bal assets -<<< = /^Income/ (Liabilities:Tithe) 0.12 @@ -61,10 +59,12 @@ bal assets 2004/02/01 Sale Assets:Checking:Business $ 30.00 Income:Sales ->>>1 + +test bal assets $ -3,804.00 Assets $ 1,396.00 Checking $ 30.00 Business $ -5,200.00 Savings -------------------- $ -3,804.00 +end test diff --git a/test/regress/5F1BAF17.test b/test/regress/5F1BAF17.test index c6580c96..e0a2a21f 100644 --- a/test/regress/5F1BAF17.test +++ b/test/regress/5F1BAF17.test @@ -1,5 +1,3 @@ -bal da39 --flat --sort amount --display-total amount -<<< 2006/02/16 b5f40e96 da39a3ee:8d437dbf:ee2bf9bd:f61e33bf $713.35 Assets @@ -107,7 +105,8 @@ bal da39 --flat --sort amount --display-total amount 2007/07/16 557e3a00 da39a3ee:8d437dbf:ee2bf9bd:f61e33bf $117.80 Assets ->>>1 + +test bal da39 --flat --sort amount --display-total amount $14.00 da39a3ee:8d437dbf:ee2bf9bd:2c7a078f $67.36 da39a3ee:8d437dbf:ee2bf9bd:14e351e1 $116.15 da39a3ee:8d437dbf:ee2bf9bd:d31d367b @@ -126,3 +125,4 @@ bal da39 --flat --sort amount --display-total amount $2,468.00 da39a3ee:8d437dbf:ee2bf9bd:75b04b88:b3850e04 -------------------- 0 +end test diff --git a/test/regress/5FBF2ED8.test b/test/regress/5FBF2ED8.test index 5f44be6a..807c1b96 100644 --- a/test/regress/5FBF2ED8.test +++ b/test/regress/5FBF2ED8.test @@ -1,5 +1,3 @@ -bal -B -<<< 2008/01/01 * Checking balance Assets:Bank:Checking £0.00 Equity:Opening Balances @@ -11,8 +9,10 @@ bal -B 2008/03/02 Salary Income:Employer £-248.07 Assets:Bank:Checking $404.82 @@ £248.07 ->>>1 + +test bal -B £582.07 Assets:Bank:Checking £-582.07 Income:Employer -------------------- 0 +end test diff --git a/test/regress/620F0674.test b/test/regress/620F0674.test index 3f81a078..585d6d8d 100644 --- a/test/regress/620F0674.test +++ b/test/regress/620F0674.test @@ -1,5 +1,3 @@ -reg bank --forecast "d<=[next year]" -d "d>=[this month] & d<=[next year]" --sort d --now=2010/06/20 -<<< ~ Monthly since 2010/01/01 Expenses:Bills:Rent $873.00 Expenses:Household $200.00 @@ -10,15 +8,25 @@ reg bank --forecast "d<=[next year]" -d "d>=[this month] & d<=[next year]" --sor Expenses:Bills:Housecleaning $85.00 Assets:Bank:Checking -2010/06/22 c897683b - ad738623:d317da42:0e30a690 A2079.00 - 208b135f:c84cc2a7:a336b63a A199.00 - 45435ee9:2d8ee712:ee7e46b1:0f0e7e54:f5dbec59 ->>> +test reg bank --forecast "d<=[next year]" -d "d>=[this month] & d<=[next year]" --sort d --now=2010/06/20 10-Jul-01 Forecast transaction Assets:Bank:Checking $1418.60 $1418.60 -10-Aug-01 Forecast transaction Assets:Bank:Checking $1418.60 $2837.20 -10-Sep-01 Forecast transaction Assets:Bank:Checking $1418.60 $4255.80 -10-Oct-01 Forecast transaction Assets:Bank:Checking $1418.60 $5674.40 -10-Nov-01 Forecast transaction Assets:Bank:Checking $1418.60 $7093.00 -10-Dec-01 Forecast transaction Assets:Bank:Checking $1418.60 $8511.60 -11-Jan-01 Forecast transaction Assets:Bank:Checking $1418.60 $9930.20 +10-Jul-04 Forecast transaction Assets:Bank:Checking $-85.00 $1333.60 +10-Jul-18 Forecast transaction Assets:Bank:Checking $-85.00 $1248.60 +10-Aug-01 Forecast transaction Assets:Bank:Checking $1418.60 $2667.20 +10-Aug-01 Forecast transaction Assets:Bank:Checking $-85.00 $2582.20 +10-Aug-15 Forecast transaction Assets:Bank:Checking $-85.00 $2497.20 +10-Aug-29 Forecast transaction Assets:Bank:Checking $-85.00 $2412.20 +10-Sep-01 Forecast transaction Assets:Bank:Checking $1418.60 $3830.80 +10-Sep-12 Forecast transaction Assets:Bank:Checking $-85.00 $3745.80 +10-Sep-26 Forecast transaction Assets:Bank:Checking $-85.00 $3660.80 +10-Oct-01 Forecast transaction Assets:Bank:Checking $1418.60 $5079.40 +10-Oct-10 Forecast transaction Assets:Bank:Checking $-85.00 $4994.40 +10-Oct-24 Forecast transaction Assets:Bank:Checking $-85.00 $4909.40 +10-Nov-01 Forecast transaction Assets:Bank:Checking $1418.60 $6328.00 +10-Nov-07 Forecast transaction Assets:Bank:Checking $-85.00 $6243.00 +10-Nov-21 Forecast transaction Assets:Bank:Checking $-85.00 $6158.00 +10-Dec-01 Forecast transaction Assets:Bank:Checking $1418.60 $7576.60 +10-Dec-05 Forecast transaction Assets:Bank:Checking $-85.00 $7491.60 +10-Dec-19 Forecast transaction Assets:Bank:Checking $-85.00 $7406.60 +11-Jan-01 Forecast transaction Assets:Bank:Checking $1418.60 $8825.20 +end test diff --git a/test/regress/647D5DB9.test b/test/regress/647D5DB9.test index cf3a797e..7e53f23b 100644 --- a/test/regress/647D5DB9.test +++ b/test/regress/647D5DB9.test @@ -1,5 +1,3 @@ -bal --end 2008/12/31 -JV Equities -<<< 2008/01/01 * Purchase Apple shares Equities 1000 AAPL @ $2 Cash @@ -11,5 +9,7 @@ bal --end 2008/12/31 -JV Equities P 2008/10/01 02:18:02 AAPL $3 P 2009/01/31 02:18:02 AAPL $4 P 3000/01/01 02:18:02 APPL $100 ->>>1 + +test bal --end 2008/12/31 -JV Equities 2008-12-31 1500 +end test diff --git a/test/regress/6DAB9FE3.test b/test/regress/6DAB9FE3.test index f26c502e..7031fd3a 100644 --- a/test/regress/6DAB9FE3.test +++ b/test/regress/6DAB9FE3.test @@ -1,8 +1,8 @@ -reg -E -<<< 2009/01/01 Sample assets 0 FOO @ $8.88 equity ->>>1 + +test reg -E 09-Jan-01 Sample assets 0 0 equity 0 0 +end test diff --git a/test/regress/727B2DF8.test b/test/regress/727B2DF8.test index d43da89c..0c32d660 100644 --- a/test/regress/727B2DF8.test +++ b/test/regress/727B2DF8.test @@ -1,5 +1,3 @@ -reg --color --force-color -<<< N $ = /^Expenses:Books/ @@ -44,7 +42,8 @@ N $ ; :MyTag: Assets:Bank:Checking ; :AnotherTag: ->>>1 + +test reg --color --force-color 04-May-01 Checking balance [34mAssets:Bank:Checking [0m $1,000.00 $1,000.00 [34mEquit:Opening Balances[0m [31m$-1,000.00[0m 0 04-May-03 Investment balance [34mAssets:Brokerage [0m 50 AAPL 50 AAPL @@ -77,3 +76,4 @@ N $ 50 AAPL [34mAssets:Bank:Checking [0m [31m$-20.00[0m [31m$-1,502.00[0m 50 AAPL +end test diff --git a/test/regress/793F6BF0.test b/test/regress/793F6BF0.test index 4842ce4c..1afe9ecb 100644 --- a/test/regress/793F6BF0.test +++ b/test/regress/793F6BF0.test @@ -1,5 +1,3 @@ -entry 2009/03/15 book 10 -<<< N $ = /^Expenses:Books/ @@ -44,7 +42,9 @@ N $ ; :MyTag: Assets:Bank:Checking ; :AnotherTag: ->>>1 + +test entry 2009/03/15 book 10 2009/03/15 Book Store Expenses:Books $10.00 Liabilities:MasterCard +end test diff --git a/test/regress/7C44010B.test b/test/regress/7C44010B.test index f0437588..962f0194 100644 --- a/test/regress/7C44010B.test +++ b/test/regress/7C44010B.test @@ -1,5 +1,3 @@ -reg -X F -J Assets -<<< D 1000,00 € 1994/1/1 Company @@ -21,10 +19,12 @@ P 2002/1/1 € 6,55957 F 2002/1/1 Company Assets:Checking 2000 € Income:Salary ->>> + +test reg -X F -J Assets 1994-01-01 10000 1998-01-01 11000 1998-01-01 10000 1998-12-31 10200 1999-01-01 9000 2002-01-01 22119.14 +end test diff --git a/test/regress/7F3650FD.test b/test/regress/7F3650FD.test index e2a53a5a..f0498ddb 100644 --- a/test/regress/7F3650FD.test +++ b/test/regress/7F3650FD.test @@ -1,6 +1,4 @@ -period --now=2010/11/01 12/01 -<<< ->>>1 +test period --now=2010/11/01 12/01 --- Period expression tokens --- TOK_DATE: month Dec day 1 END_REACHED: <EOF> @@ -15,10 +13,9 @@ END_REACHED: <EOF> --- Sample dates in range (max. 20) --- 1: 10-Dec-01 -=== 0 -period --now=2010/11/01 10/01 -<<< ->>>1 +end test + +test period --now=2010/11/01 10/01 --- Period expression tokens --- TOK_DATE: month Oct day 1 END_REACHED: <EOF> @@ -33,10 +30,9 @@ END_REACHED: <EOF> --- Sample dates in range (max. 20) --- 1: 10-Oct-01 -=== 0 -period --now=2010/11/01 2009/10 -<<< ->>>1 +end test + +test period --now=2010/11/01 2009/10 --- Period expression tokens --- TOK_DATE: year 2009 month Oct END_REACHED: <EOF> @@ -51,10 +47,9 @@ END_REACHED: <EOF> --- Sample dates in range (max. 20) --- 1: 09-Oct-01 -=== 0 -period --now=2010/11/01 2009/10/01 -<<< ->>>1 +end test + +test period --now=2010/11/01 2009/10/01 --- Period expression tokens --- TOK_DATE: year 2009 month Oct day 1 END_REACHED: <EOF> @@ -69,10 +64,9 @@ END_REACHED: <EOF> --- Sample dates in range (max. 20) --- 1: 09-Oct-01 -=== 0 -period --now=2010/11/01 2009 -<<< ->>>1 +end test + +test period --now=2010/11/01 2009 --- Period expression tokens --- TOK_A_YEAR: 2009 END_REACHED: <EOF> @@ -87,3 +81,4 @@ END_REACHED: <EOF> --- Sample dates in range (max. 20) --- 1: 09-Jan-01 +end test diff --git a/test/regress/8254755E.test b/test/regress/8254755E.test index b86fb38d..e3b85c1e 100644 --- a/test/regress/8254755E.test +++ b/test/regress/8254755E.test @@ -1,5 +1,3 @@ -bal --flat food:out --now=2009/12/31 -<<< ~ Monthly Expenses:Auto:Fuel $120.00 Expenses:Food:Out $100.00 @@ -9,9 +7,11 @@ bal --flat food:out --now=2009/12/31 2009/11/01 Expenses:Food:Out $50.00 Assets ->>>1 + +test bal --flat food:out --now=2009/12/31 $50.00 Expenses:Food:Out -=== 0 -bal --flat --budget food:out --now=2009/12/31 ->>>1 +end test + +test bal --flat --budget food:out --now=2009/12/31 $-150.00 Expenses:Food:Out +end test diff --git a/test/regress/86D2BDC4.test b/test/regress/86D2BDC4.test index 40b61260..dd843a95 100644 --- a/test/regress/86D2BDC4.test +++ b/test/regress/86D2BDC4.test @@ -1,10 +1,10 @@ -reg -B -<<< 2009/06/03 Westjet Expenses:Transportation:Air C$429.80 @ 1.572865 Expenses:Bank:Fees 2.73 Liabilities:Mastercard ->>>1 + +test reg -B 09-Jun-03 Westjet Expe:Transportatio:Air 676.017377 676.017377 Expenses:Bank:Fees 2.73 678.747377 Liabilities:Mastercard -678.747377 0 +end test diff --git a/test/regress/9EB10714.test b/test/regress/9EB10714.test index 9fd49b7a..a2698f93 100644 --- a/test/regress/9EB10714.test +++ b/test/regress/9EB10714.test @@ -1,5 +1,3 @@ -reg -J -V ^Actif -<<< 1994/01/01 Achat Rialto Actif:Fixe:Rialto 2 Rialto Actif:BNP -120000 € @@ -22,7 +20,8 @@ P 2007/01/01 Rialto 190000 € P 2008/01/01 Rialto 200000 € P 2009/01/01 Rialto 210000 € P 2010/01/01 Rialto 211000 € ->>> + +test reg -J -V ^Actif 1994-01-01 120000 1994-01-01 0 1994-01-01 120000 @@ -41,3 +40,4 @@ P 2010/01/01 Rialto 211000 € 2008-01-01 400000 2009-01-01 420000 2010-01-01 422000 +end test diff --git a/test/regress/A28CF697.test b/test/regress/A28CF697.test index 513dbd97..dd04c275 100644 --- a/test/regress/A28CF697.test +++ b/test/regress/A28CF697.test @@ -1,9 +1,9 @@ -print -<<< 2010-02-05 * Flight SN2094 Assets:Rewards:Airmiles 125 "M&M" Income:Rewards ->>> + +test print 2010/02/05 * Flight SN2094 Assets:Rewards:Airmiles 125 "M&M" Income:Rewards +end test diff --git a/test/regress/B68FFB0D.test b/test/regress/B68FFB0D.test index f6bf5528..8c48db69 100644 --- a/test/regress/B68FFB0D.test +++ b/test/regress/B68FFB0D.test @@ -1,13 +1,13 @@ -print -<<< D $1,000.00 2009/01/01 Sample assets 134.123 FOO @ $8.88 assets 100 BAR @ $8.88 equity ->>>1 + +test print 2009/01/01 Sample assets 134.123 FOO @ $8.88 assets 100 BAR @ $8.88 equity +end test diff --git a/test/regress/BBFA1759.test b/test/regress/BBFA1759.test index 5af1745c..7a402d0c 100644 --- a/test/regress/BBFA1759.test +++ b/test/regress/BBFA1759.test @@ -1,6 +1,5 @@ -period june 2008 -<<< ->>>1 + +test period june 2008 --- Period expression tokens --- TOK_A_MONTH: Jun TOK_A_YEAR: 2008 @@ -16,3 +15,4 @@ END_REACHED: <EOF> --- Sample dates in range (max. 20) --- 1: 08-Jun-01 +end test diff --git a/test/regress/C0212EAC.test b/test/regress/C0212EAC.test index da178054..9a572ef6 100644 --- a/test/regress/C0212EAC.test +++ b/test/regress/C0212EAC.test @@ -1,5 +1,3 @@ -reg -<<< 2007-01-01 Opening balances Assets:Cash 10.00 EUR Equity:Opening balances @@ -14,7 +12,8 @@ reg Income:Gain P 2009-02-01 00:00:00 GBP 1.5 EUR ->>> + +test reg 07-Jan-01 Opening balances Assets:Cash 10.00 EUR 10.00 EUR Equit:Opening balances -10.00 EUR 0 08-Jan-01 Buy 5.00 GBP Assets:Cash 5.00 GBP 5.00 GBP @@ -31,3 +30,4 @@ P 2009-02-01 00:00:00 GBP 1.5 EUR Equity:Capital Gains 0.50 EUR 0.50 EUR 5.00 GBP -5.00 GBP {=1.40 EUR} +end test diff --git a/test/regress/C523E23F.test b/test/regress/C523E23F.test index 8d941f4a..8512f21a 100644 --- a/test/regress/C523E23F.test +++ b/test/regress/C523E23F.test @@ -1,5 +1,3 @@ -bal -<<< D 1.000,00€ 2009/03/16 * denn's @@ -10,10 +8,12 @@ D 1.000,00€ 2009/03/24 Ansparen Aktiva:Bank:Sparkonto 800,00€ Aktiva:Bank:Girokonto ->>>1 + +test bal -17,94€ Aktiva:Bank -817,94€ Girokonto 800,00€ Sparkonto 17,94€ Aufwand:Einkauf:Lebensmittel -------------------- 0 +end test diff --git a/test/regress/D060256A.test b/test/regress/D060256A.test index 579d3ab1..46c32054 100644 --- a/test/regress/D060256A.test +++ b/test/regress/D060256A.test @@ -1,5 +1,3 @@ -budget --now=2009/11/01 --end=2009/11/30 -<<< ~ Monthly Expenses:Food $500.00 Assets @@ -7,8 +5,10 @@ budget --now=2009/11/01 --end=2009/11/30 2009/11/01 Sample Expenses:Food:Dining $20.00 Assets ->>>1 + +test budget --now=2009/11/01 --end=2009/11/30 $-20.00 $-500.00 $480.00 4% Assets $20.00 $500.00 $-480.00 4% Expenses:Food ------------ ------------ ------------ ----- 0 0 0 0 +end test diff --git a/test/regress/D2829FC4.test b/test/regress/D2829FC4.test index 83c991fd..fc0dc10e 100644 --- a/test/regress/D2829FC4.test +++ b/test/regress/D2829FC4.test @@ -1,5 +1,3 @@ -reg --forecast 'date<[2011]' --now=2010/06/20 -<<< ~ Monthly since 2010/01/01 Expenses:Bills:Rent $873.00 Expenses:Household $200.00 @@ -14,7 +12,8 @@ reg --forecast 'date<[2011]' --now=2010/06/20 ad738623:d317da42:0e30a690 A2079.00 208b135f:c84cc2a7:a336b63a A199.00 45435ee9:2d8ee712:ee7e46b1:0f0e7e54:f5dbec59 ->>> + +test reg --forecast 'date<[2011]' --now=2010/06/20 10-Jun-22 c897683b ad738:d317da4:0e30a690 A2079.00 A2079.00 208b1:c84cc2a:a336b63a A199.00 A2278.00 45:2d:ee:0f0e:f5dbec59 A-2278.00 0 @@ -70,3 +69,4 @@ reg --forecast 'date<[2011]' --now=2010/06/20 10-Dec-12 Forecast transaction Assets:Bank:Checking $-85.00 0 10-Dec-26 Forecast transaction Exp:Bill:Housecleaning $85.00 $85.00 10-Dec-26 Forecast transaction Assets:Bank:Checking $-85.00 0 +end test diff --git a/test/regress/D943AE0F.test b/test/regress/D943AE0F.test index 7b3159a6..960fbe13 100644 --- a/test/regress/D943AE0F.test +++ b/test/regress/D943AE0F.test @@ -1,5 +1,3 @@ -reg -V -<<< D 1000.00 EUR 2008/04/15 * Paid expenses back from cie. @@ -7,7 +5,9 @@ D 1000.00 EUR Assets:Checking P 2008/04/20 00:00:00 CAD 1.20 EUR ->>>1 + +test reg -V 08-Apr-15 Paid expenses back .. Exp:Cie-Reimbursements 2200.00 EUR 2200.00 EUR Assets:Checking -2200.00 EUR 0 08-Apr-20 Commodities revalued <Revalued> 200.00 EUR 200.00 EUR +end test diff --git a/test/regress/E4C9A8EA.test b/test/regress/E4C9A8EA.test index 6910536f..db83f079 100644 --- a/test/regress/E4C9A8EA.test +++ b/test/regress/E4C9A8EA.test @@ -1,5 +1,3 @@ -reg -<<< 2007/12/31 * Cost basis for: RED HAT INC RHT Assets:Investments:RBC-Broker:Account-RSP 4 RHT Equity:Opening-Balances:Cost -689.87 CAD @@ -9,7 +7,8 @@ reg Expenses:Financial:Commissions 9.95 USD @ 0.96590 CAD Assets:Investments:RBC-Broker:Account-RSP 72.06 CAD Expenses:Financial:Fees ->>>1 + +test reg 07-Dec-31 Cost basis for: RED.. As:In:RBC-:Account-RSP 4.00 RHT 4.00 RHT Eq:Opening-Balanc:Cost -689.87 CAD -689.87 CAD 4.00 RHT @@ -20,3 +19,4 @@ reg 9.95 USD Expense:Financial:Fees 2.89 CAD -614.92 CAD 9.95 USD +end test diff --git a/test/regress/E627C594.test b/test/regress/E627C594.test index 89e4b353..0914affd 100644 --- a/test/regress/E627C594.test +++ b/test/regress/E627C594.test @@ -1,5 +1,3 @@ -reg --forecast-while="d<[2010/03/01]" --now=2009/11/01 -<<< ~ Monthly Expenses:Food $500.00 Assets @@ -7,7 +5,8 @@ reg --forecast-while="d<[2010/03/01]" --now=2009/11/01 2009/11/01 Sample Expenses:Food:Dining $20.00 Assets ->>>1 + +test reg --forecast-while="d<[2010/03/01]" --now=2009/11/01 09-Nov-01 Sample Expenses:Food:Dining $20.00 $20.00 Assets $-20.00 0 09-Dec-01 Forecast transaction Expenses:Food $500.00 $500.00 @@ -16,3 +15,4 @@ reg --forecast-while="d<[2010/03/01]" --now=2009/11/01 10-Jan-01 Forecast transaction Assets $-500.00 0 10-Feb-01 Forecast transaction Expenses:Food $500.00 $500.00 10-Feb-01 Forecast transaction Assets $-500.00 0 +end test diff --git a/test/regress/E9F130C5.test b/test/regress/E9F130C5.test index d6237276..d74fdb2d 100644 --- a/test/regress/E9F130C5.test +++ b/test/regress/E9F130C5.test @@ -1,5 +1,3 @@ -bal as -<<< 2008/01/01 income assets:bank:checking $1 income:salary @@ -20,9 +18,11 @@ bal as 2008/12/31 * pay off liabilities:debts $1 assets:bank:checking ->>>1 + +test bal as $-1 assets $1 bank:saving $-2 cash -------------------- $-1 +end test diff --git a/test/regress/F559EC12.test b/test/regress/F559EC12.test index bc7f9581..ceb36e7f 100644 --- a/test/regress/F559EC12.test +++ b/test/regress/F559EC12.test @@ -1,6 +1,4 @@ -format "%-12(scrub(amount))" -<<< ->>>1 +test format "%-12(scrub(amount))" --- Context is first posting of the following transaction --- 2004/05/27 Book Store ; This note applies to all postings. :SecondTag: @@ -19,9 +17,9 @@ Element: EXPR flags: 0x1 min: 12 max: 0 expr: scrub(amount) --- Formatted string --- "20 BOOK " -=== 0 -format "%12(scrub(amount))" ->>>1 +end test + +test format "%12(scrub(amount))" --- Context is first posting of the following transaction --- 2004/05/27 Book Store ; This note applies to all postings. :SecondTag: @@ -40,3 +38,4 @@ Element: EXPR flags: 0x0 min: 12 max: 0 expr: scrub(amount) --- Formatted string --- " 20 BOOK" +end test diff --git a/test/run b/test/run deleted file mode 100755 index 55eb39f3..00000000 --- a/test/run +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -LEDGER=ledger -ARGS="--args-only --no-color --columns=80" - -output_only=false -update_test=false -if [[ "$1" == "-v" ]]; then - output_only=true - shift 1 -elif [[ "$1" == "-u" ]]; then - update_test=true - shift 1 -fi - -COMMAND=$(perl -ne 'print unless /^<<</ .. eof();' $1) - -if [[ $output_only == false && $update_test == false ]]; then - perl -ne 'print unless 1 .. /^>>>/ or /^(===|>>>2)/ .. eof();' $1 > /tmp/expected.$$ -fi - -perl -ne 'print unless 1 .. /^<<</ or /^>>>/ .. eof();' $1 \ - | eval "$LEDGER -f - -o /tmp/received.$$ $ARGS $COMMAND" - -if [[ $update_test == true ]]; then - if [[ -f /tmp/received.$$ ]]; then - perl -ne 'print if 1 .. /^>>>/;' $1 > /tmp/command.$$ - perl -ne 'print if /^(===|>>>2)/ .. eof();' $1 > /tmp/epilog.$$ - cat /tmp/command.$$ /tmp/received.$$ /tmp/epilog.$$ > replace.$$ - mv replace.$$ $1 - /bin/rm -f /tmp/command.$$ /tmp/received.$$ /tmp/epilog.$$ - echo Test updated. - fi - -elif [[ $output_only == false ]]; then - if [[ -f /tmp/expected.$$ && -f /tmp/received.$$ ]]; then - diff -w -U3 /tmp/expected.$$ /tmp/received.$$ && echo Test passed. - fi - -elif [[ -f /tmp/received.$$ ]]; then - cat /tmp/received.$$ -fi - -/bin/rm -f /tmp/expected.$$ /tmp/received.$$ |