From fde30f19774f9b933722f9bdf33cce59df129980 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 18 Feb 2015 21:33:22 +0100 Subject: [tests] Allow testing of multi-line examples --- test/DocTests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/DocTests.py b/test/DocTests.py index cbad9ca7..04241188 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -113,7 +113,7 @@ class DocTests: else: return None - command = shlex.split(command) + command = filter(lambda x: x != '\n', shlex.split(command)) if command[0] == '$': command.remove('$') index = command.index('ledger') command[index] = self.ledger -- cgit v1.2.3 From a48e3014baa105576d18c28fc8a83c44b11623c3 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 20 Feb 2015 13:59:51 +0100 Subject: [tests] Clean-up test/DocTests.py * Replace hard-coded strings with token variables * Use os.path.join to create file paths --- test/DocTests.py | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'test') diff --git a/test/DocTests.py b/test/DocTests.py index 04241188..07cb616e 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -19,13 +19,15 @@ class DocTests: self.verbose = args.verbose self.tests = args.examples - self.examples = dict() - self.test_files = list() - self.testin_token = 'command' - self.testout_token = 'output' - self.testdat_token = 'input' + self.examples = dict() + self.test_files = list() + self.testin_token = 'command' + self.testout_token = 'output' + self.testdat_token = 'input' self.validate_token = 'validate' - self.testwithdat_token = 'with_input' + self.validate_cmd_token = 'validate-command' + self.validate_dat_token = 'validate-data' + self.testwithdat_token = 'with_input' def read_example(self): endexample = re.compile(r'^@end\s+smallexample\s*$') @@ -35,7 +37,7 @@ class DocTests: self.current_line += 1 if len(line) <= 0 or endexample.match(line): break # Replace special texinfo character sequences with their ASCII counterpart - example += line.replace("@@","@").replace("@{","{").replace("@}","}") + example += re.sub(r'@([@{}])', r'\1', line) return example def test_id(self, example): @@ -78,9 +80,9 @@ class DocTests: if test_id == self.validate_token: test_id = "Val-" + str(test_begin_line) if test_kind == self.testin_token: - test_kind = "validate-command" + test_kind = self.validate_cmd_token elif test_kind == self.testdat_token: - test_kind = "validate-data" + test_kind = self.validate_dat_token try: self.examples[test_id] except KeyError: @@ -105,11 +107,11 @@ class DocTests: try: command = example[self.testin_token][self.testin_token] except KeyError: - if 'validate-data' in example: + if self.validate_dat_token in example: command = '$ ledger bal' - elif 'validate-command' in example: + elif self.validate_cmd_token in example: validate_command = True - command = example['validate-command']['validate-command'] + command = example[self.validate_cmd_token][self.validate_cmd_token] else: return None @@ -145,7 +147,7 @@ class DocTests: for test_id in tests: validation = False - if "validate-data" in self.examples[test_id] or "validate-command" in self.examples[test_id]: + if self.validate_dat_token in self.examples[test_id] or self.validate_cmd_token in self.examples[test_id]: validation = True example = self.examples[test_id] try: @@ -167,7 +169,7 @@ class DocTests: input = self.examples[with_input][self.testdat_token][self.testdat_token] except KeyError: try: - input = example['validate-data']['validate-data'] + input = example[self.validate_dat_token][self.validate_dat_token] except KeyError: input = None @@ -175,16 +177,16 @@ class DocTests: test_file_created = False if findex: scriptpath = os.path.dirname(os.path.realpath(__file__)) - test_input_dir = scriptpath + '/../test/input/' + test_input_dir = os.path.join(scriptpath, '..', 'test', 'input') test_file = command[findex] if not os.path.exists(test_file): if input: test_file_created = True with open(test_file, 'w') as f: f.write(input) - elif os.path.exists(test_input_dir + test_file): - command[findex] = test_input_dir + test_file error = False + elif os.path.exists(os.path.join(test_input_dir, test_file)): + command[findex] = os.path.join(test_input_dir, test_file) try: verify = subprocess.check_output(command, stderr=subprocess.STDOUT) except: -- cgit v1.2.3 From f5b8fe59565ead295dce0a42b701703e24ca8e40 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 20 Feb 2015 14:00:57 +0100 Subject: [tests] Add output when skipping incomplete tests in test/DocTests.py --- test/DocTests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/DocTests.py b/test/DocTests.py index 07cb616e..671c4d35 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -173,7 +173,7 @@ class DocTests: except KeyError: input = None - if command and (output or validation): + if command and (output != None or validation): test_file_created = False if findex: scriptpath = os.path.dirname(os.path.realpath(__file__)) @@ -208,6 +208,12 @@ class DocTests: for line in unified_diff(output.split('\n'), verify.split('\n'), fromfile='generated', tofile='expected'): print(line) print + else: + if self.verbose > 0: + print test_id, ':', 'Skipped' + else: + sys.stdout.write('X') + if not self.verbose: print if len(failed) > 0: -- cgit v1.2.3 From 34f8c482414775cfb75de32b4181150642a4610d Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 20 Feb 2015 14:02:16 +0100 Subject: [tests] Improve error reporting for test/DocTests.py --- test/DocTests.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/DocTests.py b/test/DocTests.py index 671c4d35..6f0276da 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -184,23 +184,25 @@ class DocTests: test_file_created = True with open(test_file, 'w') as f: f.write(input) - error = False elif os.path.exists(os.path.join(test_input_dir, test_file)): command[findex] = os.path.join(test_input_dir, test_file) + try: + error = None try: verify = subprocess.check_output(command, stderr=subprocess.STDOUT) - except: - verify = str() - error = True - valid = (output == verify) or (not error and validation) + valid = (output == verify) or (not error and validation) + except subprocess.CalledProcessError, e: + error = e.output + valid = False + failed.add(test_id) if valid and test_file_created: os.remove(test_file) if self.verbose > 0: - print test_id, ':', 'Passed' if valid else 'FAILED' + print test_id, ':', 'Passed' if valid else 'FAILED: {}'.format(error) if error else 'FAILED' else: sys.stdout.write('.' if valid else 'E') - if not valid: + if not (valid or error): failed.add(test_id) if self.verbose > 1: print ' '.join(command) -- cgit v1.2.3 From c1e409e6934ba298cc71dfb7c6a0079d2038b09d Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 20 Feb 2015 14:07:57 +0100 Subject: [doc] Add support for additional input files in test/DocTests.py by allowing file: and with_file: options on examples. --- doc/ledger3.texi | 13 +++++++++++++ test/DocTests.py | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 3caf4d14..ea4c0e89 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -88,6 +88,19 @@ @c $ 36.84 Expenses:Food:Dining @c @end smallexample @c +@c To pass additional input to ledger for certain commands, e.g. convert add +@c with_file:filename to the example command and add a file:UUID to an example +@c that holds the additional input, where UUID is the UUID of the command, +@c e.g.: +@c +@c @smallexample @c file:download.csv +@c 767718,12/13/2011,"Withdrawal","ACE HARDWARE 16335 S HOUGHTON RD",-8.80,,00001640.04,, +@c @end smallexample +@c +@c @smallexample @c command:94FD2B6,with_file:download.csv +@c $ ledger -f sample.dat convert download.csv +@c @end smallexample +@c @c Additionally DocTests.py will pass --args-only and --columns 80 to ledger @c to ignore any default arguments from the environment or .ledgerrc. @c diff --git a/test/DocTests.py b/test/DocTests.py index 6f0276da..f5746ec4 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -24,10 +24,12 @@ class DocTests: self.testin_token = 'command' self.testout_token = 'output' self.testdat_token = 'input' + self.testfile_token = 'file' self.validate_token = 'validate' self.validate_cmd_token = 'validate-command' self.validate_dat_token = 'validate-data' self.testwithdat_token = 'with_input' + self.testwithfile_token = 'with_file' def read_example(self): endexample = re.compile(r'^@end\s+smallexample\s*$') @@ -44,8 +46,8 @@ class DocTests: return hashlib.sha1(example.rstrip()).hexdigest()[0:7].upper() def find_examples(self): - startexample = re.compile(r'^@smallexample\s+@c\s+(%s|%s|%s)(?::([\dA-Fa-f]+|validate))?(?:,(.*))?' - % (self.testin_token, self.testout_token, self.testdat_token)) + startexample = re.compile(r'^@smallexample\s+@c\s+(%s|%s|%s|%s)(?::([\dA-Fa-f]+|validate))?(?:,(.*))?' + % (self.testin_token, self.testout_token, self.testdat_token, self.testfile_token)) while True: line = self.file.readline() self.current_line += 1 @@ -187,6 +189,14 @@ class DocTests: elif os.path.exists(os.path.join(test_input_dir, test_file)): command[findex] = os.path.join(test_input_dir, test_file) try: + convert_idx = command.index('convert') + convert_file = command[convert_idx+1] + convert_data = example[self.testfile_token][self.testfile_token] + if not os.path.exists(convert_file): + with open(convert_file, 'w') as f: + f.write(convert_data) + except ValueError: + pass error = None try: verify = subprocess.check_output(command, stderr=subprocess.STDOUT) -- cgit v1.2.3 From 6f6d4ec26cf10d8e2af45b54efaf1b05272c1c02 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 20 Feb 2015 23:09:26 +0100 Subject: [tests] Minor test/DocTests.py clean up --- test/DocTests.py | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'test') diff --git a/test/DocTests.py b/test/DocTests.py index f5746ec4..ac681bc2 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -158,22 +158,13 @@ class DocTests: failed.add(test_id) continue - try: - output = example[self.testout_token][self.testout_token] - except KeyError: - output = None - - try: - input = example[self.testdat_token][self.testdat_token] - except KeyError: - try: - with_input = example[self.testin_token]['opts'][self.testwithdat_token] - input = self.examples[with_input][self.testdat_token][self.testdat_token] - except KeyError: - try: - input = example[self.validate_dat_token][self.validate_dat_token] - except KeyError: - input = None + output = example.get(self.testout_token, {}).get(self.testout_token) + input = example.get(self.testdat_token, {}).get(self.testdat_token) + if not input: + with_input = example.get(self.testin_token, {}).get('opts', {}).get(self.testwithdat_token) + input = self.examples.get(with_input, {}).get(self.testdat_token, {}).get(self.testdat_token) + if not input: + input = example.get(self.validate_dat_token, {}).get(self.validate_dat_token) if command and (output != None or validation): test_file_created = False -- cgit v1.2.3 From 459f587012121f8b81f06c9eb807337c5178009e Mon Sep 17 00:00:00 2001 From: thdox Date: Thu, 12 Feb 2015 23:46:37 +0100 Subject: Improve documentation about --rich-data. Conflicts: doc/ledger.1 --- doc/ledger.1 | 11 ++++++++++- doc/ledger3.texi | 6 ++---- test/baseline/opt-rich-data.test | 10 ++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/doc/ledger.1 b/doc/ledger.1 index 8284dfa4..8925e6f9 100644 --- a/doc/ledger.1 +++ b/doc/ledger.1 @@ -510,6 +510,12 @@ but not .Sy Expenses:Entertainment:Dining . This is a display predicate, which means it only affects display, not the total calculations. +.It Fl \-detail +Related to +.Ic convert +command. Synonym to +.Fl \-rich-data +option. .It Fl \-deviation Report each posting's deviation from the average. It is only meaningful in the @@ -871,7 +877,10 @@ postings. .It Fl \-revalued-total Display the sum of the revalued postings as the running total, which serves to show unrealized capital in a gain/losses report. -.\".It Fl \-rich-data +.It Fl \-rich-data +When generating ledger transaction from CSV file using the +.Ic convert +command, add CSV, Imported, and UUID meta-data. .It Fl \-seed Ar INT Set the random seed to .Ar INT diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 936a69e0..56796374 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -6629,10 +6629,8 @@ to show unrealized capital in a gain/losses report. @item --rich-data @itemx --detail -@c When generating ledger transaction from csv using the convert command -@c add CSV, Imported, and UUID meta-data. -@c see test/baeline/opt-rich-data.test -@value{FIXME:UNDOCUMENTED} +When generating ledger transaction from CSV file using the +@command{convert} command, add CSV, Imported, and UUID meta-data. @item --seed @var{INT} Set the random seed to @var{INT} for the @code{generate} command. diff --git a/test/baseline/opt-rich-data.test b/test/baseline/opt-rich-data.test index fbb73ebe..265af531 100644 --- a/test/baseline/opt-rich-data.test +++ b/test/baseline/opt-rich-data.test @@ -1,3 +1,13 @@ +test -f /dev/null convert test/baseline/feat-convert-with-directives.dat --now '2014/08/01' +2012/01/01 * KFC + Expenses:Unknown $10 + Equity:Unknown + +2012/01/02 * REWE SAGT DANKE 123454321 + Expenses:Unknown 10€ + Equity:Unknown +end test + test -f /dev/null convert test/baseline/feat-convert-with-directives.dat --detail --now '2014/08/01' 2012/01/01 * KFC ; CSV: 2012/01/01,KFC,$10 -- cgit v1.2.3 From 788ffc2a4bfdb95782163eeb463ff9c05947a311 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 22 Feb 2015 16:51:57 +0100 Subject: Update test for --auto-match option. --- test/baseline/opt-auto-match.test | 47 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/baseline/opt-auto-match.test b/test/baseline/opt-auto-match.test index 7c3fb40a..54a1053b 100644 --- a/test/baseline/opt-auto-match.test +++ b/test/baseline/opt-auto-match.test @@ -14,17 +14,58 @@ Expenses:Food 20.00 EUR Liabilities:CC -20.00 EUR +test --input-date-format "%Y-%m-%d" convert test/baseline/opt-auto-match.dat +2012/03/01 * Food + Expenses:Unknown 10 + Equity:Unknown + +2012/03/02 * Phone + Expenses:Unknown 10 + Equity:Unknown + +2012/03/02 * Dining + Expenses:Unknown 10 + Equity:Unknown +end test + test --input-date-format "%Y-%m-%d" --auto-match convert test/baseline/opt-auto-match.dat 2012/03/01 * Food - Assets:Cash 10 + Expenses:Food 10 Equity:Unknown 2012/03/02 * Phone - Assets:Cash 10 + Expenses:Phone 10 Equity:Unknown 2012/03/02 * Dining - Liabilities:CC 10 + Expenses:Food 10 Equity:Unknown end test +test --input-date-format "%Y-%m-%d" --account Assets:Bank convert test/baseline/opt-auto-match.dat +2012/03/01 * Food + Expenses:Unknown 10 + Assets:Bank + +2012/03/02 * Phone + Expenses:Unknown 10 + Assets:Bank + +2012/03/02 * Dining + Expenses:Unknown 10 + Assets:Bank +end test + +test --input-date-format "%Y-%m-%d" --auto-match --account Assets:Bank convert test/baseline/opt-auto-match.dat +2012/03/01 * Food + Expenses:Food 10 + Assets:Bank + +2012/03/02 * Phone + Expenses:Phone 10 + Assets:Bank + +2012/03/02 * Dining + Expenses:Food 10 + Assets:Bank +end test -- cgit v1.2.3 From 73e3ecc6b865ecff63ccda307d4dbf70ec55a9c4 Mon Sep 17 00:00:00 2001 From: thdox Date: Mon, 23 Feb 2015 23:31:21 +0100 Subject: Fix alignment of cleared-format with 4 spaces as separator. --- doc/ledger3.texi | 4 ++-- src/report.h | 2 +- test/baseline/cmd-cleared.test | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 4a3d51e0..a2083e38 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -651,7 +651,7 @@ $ ledger -f drewr3.dat cleared $ -20.00 0 MasterCard $ 200.00 0 Mortgage:Principal $ -243.60 0 Tithe ----------------- ---------------- --------- +---------------- ---------------- --------- $ -243.60 0 @end smallexample @@ -7172,7 +7172,7 @@ Define the format for the cleared report. The default is: %-(ansify_if(partial_account(options.flat), blue if color))\n%/ %$1 %$2 %$3\n%/ %(prepend_width ? \" \" * int(prepend_width) : \"\") - ---------------- ---------------- ---------\n" + ---------------- ---------------- ---------\n" @end smallexample @item --register-format @var{FORMAT_STRING} diff --git a/src/report.h b/src/report.h index 67e95884..c54c8444 100644 --- a/src/report.h +++ b/src/report.h @@ -496,7 +496,7 @@ public: "%-(ansify_if(partial_account(options.flat), blue if color))\n%/" "%$1 %$2 %$3\n%/" "%(prepend_width ? \" \" * int(prepend_width) : \"\")" - "---------------- ---------------- ---------\n"); + "---------------- ---------------- ---------\n"); }); OPTION(report_t, color); diff --git a/test/baseline/cmd-cleared.test b/test/baseline/cmd-cleared.test index 501d207f..91219a40 100644 --- a/test/baseline/cmd-cleared.test +++ b/test/baseline/cmd-cleared.test @@ -30,7 +30,7 @@ test cleared -20 0 F -30 -30 12-Feb-26 G -40 0 H ----------------- ---------------- --------- +---------------- ---------------- --------- 0 0 end test -- cgit v1.2.3 From ddf17b62460f17e0cca3b01a40e838544d683f91 Mon Sep 17 00:00:00 2001 From: thdox Date: Tue, 24 Feb 2015 10:46:18 +0100 Subject: Add baseline test for --init-file option. --- test/CheckBaselineTests.py | 1 - test/baseline/opt-init-file.dat | 1 + test/baseline/opt-init-file.test | 10 ++++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/baseline/opt-init-file.dat create mode 100644 test/baseline/opt-init-file.test (limited to 'test') diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index 3c3e590b..dd6f4702 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -33,7 +33,6 @@ class CheckBaselineTests (CheckOptions): 'help-comm', 'help-disp', 'import', - 'init-file', 'no-color', 'options', 'price-db', diff --git a/test/baseline/opt-init-file.dat b/test/baseline/opt-init-file.dat new file mode 100644 index 00000000..92c5307a --- /dev/null +++ b/test/baseline/opt-init-file.dat @@ -0,0 +1 @@ +--decimal-comma diff --git a/test/baseline/opt-init-file.test b/test/baseline/opt-init-file.test new file mode 100644 index 00000000..128814e1 --- /dev/null +++ b/test/baseline/opt-init-file.test @@ -0,0 +1,10 @@ +2012-03-17 Quick + Expenses:Food 12,50 € + Assets:Cash + +test --init-file test/baseline/opt-init-file.dat bal + -12,50 € Assets:Cash + 12,50 € Expenses:Food +-------------------- + 0 +end test -- cgit v1.2.3 From fce467fba9ebce81c0235916ff4848f50f1f1f21 Mon Sep 17 00:00:00 2001 From: thdox Date: Tue, 24 Feb 2015 10:49:16 +0100 Subject: Remove --cache from untested options in CheckBaselinetests.py As per commit d5e1308d07e9a7d9da33aed6f7f617b2209cba40 --- test/CheckBaselineTests.py | 1 - 1 file changed, 1 deletion(-) (limited to 'test') diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index dd6f4702..e44c576d 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -21,7 +21,6 @@ class CheckBaselineTests (CheckOptions): self.untested_options = [ 'anon', 'args-only', - 'cache', 'debug', 'download', 'file', -- cgit v1.2.3 From 83bde60ec1c8bb7efcb9145ee8ebb4b3bceb3789 Mon Sep 17 00:00:00 2001 From: thdox Date: Tue, 24 Feb 2015 10:52:56 +0100 Subject: Remove --*help* from untested options in CheckBaselineTests.py As per commit f59abd4c765b08cbd5f18ec851b1d78a766a1c93 --- test/CheckBaselineTests.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'test') diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index e44c576d..e3c8f385 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -26,11 +26,7 @@ class CheckBaselineTests (CheckOptions): 'file', 'force-color', 'force-pager', - 'full-help', 'help', - 'help-calc', - 'help-comm', - 'help-disp', 'import', 'no-color', 'options', -- cgit v1.2.3 From 72cb48727d979c8a20298ccdb9c711b0ce7a8a03 Mon Sep 17 00:00:00 2001 From: thdox Date: Tue, 24 Feb 2015 10:54:57 +0100 Subject: Add --no-pager to untested options of CheckBaselineTests.py As per comment in Pull Request #382 --- test/CheckBaselineTests.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index e3c8f385..1bef0aa0 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -29,6 +29,7 @@ class CheckBaselineTests (CheckOptions): 'help', 'import', 'no-color', + 'no-pager' 'options', 'price-db', 'price-exp', -- cgit v1.2.3 From e6a967b860d529137df11b2a79b2153c68e48b96 Mon Sep 17 00:00:00 2001 From: thdox Date: Tue, 24 Feb 2015 18:47:40 +0100 Subject: Add baseline test for --script option. --- test/CheckBaselineTests.py | 1 - test/baseline/opt-script.dat | 3 +++ test/baseline/opt-script.test | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/baseline/opt-script.dat create mode 100644 test/baseline/opt-script.test (limited to 'test') diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index 1bef0aa0..563f8aa5 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -34,7 +34,6 @@ class CheckBaselineTests (CheckOptions): 'price-db', 'price-exp', 'revalued-total', - 'script', 'seed', 'trace', 'verbose', diff --git a/test/baseline/opt-script.dat b/test/baseline/opt-script.dat new file mode 100644 index 00000000..ac6085d5 --- /dev/null +++ b/test/baseline/opt-script.dat @@ -0,0 +1,3 @@ +--no-pager --columns=80 bal +--no-pager --columns=80 reg +--no-pager --columns=80 print diff --git a/test/baseline/opt-script.test b/test/baseline/opt-script.test new file mode 100644 index 00000000..041c15ee --- /dev/null +++ b/test/baseline/opt-script.test @@ -0,0 +1,15 @@ +2012-03-17 KFC + Expenses:Food 20 CAD + Assets:Cash + +test --script test/baseline/opt-script.dat + -20 CAD Assets:Cash + 20 CAD Expenses:Food +-------------------- + 0 +12-Mar-17 KFC Expenses:Food 20 CAD 20 CAD + Assets:Cash -20 CAD 0 +2012/03/17 KFC + Expenses:Food 20 CAD + Assets:Cash +end test -- cgit v1.2.3 From df944929f82b473bbd155eac826420f0b38644eb Mon Sep 17 00:00:00 2001 From: thdox Date: Tue, 24 Feb 2015 10:42:37 +0100 Subject: Add baseline test for --price-db option. --- test/CheckBaselineTests.py | 1 - test/baseline/opt-price-db.dat | 2 ++ test/baseline/opt-price-db.test | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/baseline/opt-price-db.dat create mode 100644 test/baseline/opt-price-db.test (limited to 'test') diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index 563f8aa5..8c51ddef 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -31,7 +31,6 @@ class CheckBaselineTests (CheckOptions): 'no-color', 'no-pager' 'options', - 'price-db', 'price-exp', 'revalued-total', 'seed', diff --git a/test/baseline/opt-price-db.dat b/test/baseline/opt-price-db.dat new file mode 100644 index 00000000..abc51a0a --- /dev/null +++ b/test/baseline/opt-price-db.dat @@ -0,0 +1,2 @@ +P 2012-03-16 06:47:12 CAD $2.50 +P 2012-03-17 06:47:12 CAD $3.50 diff --git a/test/baseline/opt-price-db.test b/test/baseline/opt-price-db.test new file mode 100644 index 00000000..06021e4a --- /dev/null +++ b/test/baseline/opt-price-db.test @@ -0,0 +1,8 @@ +2012-03-17 KFC + Expenses:Food 20 CAD + Assets:Cash + +test pricedb --price-db test/baseline/opt-price-db.dat +P 2012/03/16 06:47:12 CAD $2.5 +P 2012/03/17 06:47:12 CAD $3.5 +end test -- cgit v1.2.3