Commit Graph

29 Commits

Author SHA1 Message Date
Brian Wignall
c823f5b51a Get "make functest" working again 2020-01-07 15:58:54 -08:00
Brian Wignall
e12b0a4f05 Get "make functest" working again 2020-01-07 15:58:54 -08:00
Brian Wignall
28f9f043e5 Get "make functest" (mostly) working again 2020-01-07 15:58:54 -08:00
Mykola Orliuk
78146978f4 ;lib: store raw opts unquoted
It looks like we only need quote when we build query and in some
messages.

Fixes simonmichael/hledger#1079
2019-10-19 14:44:08 -07:00
Jakob Schöttl
4d76535b6d Add CLI/shelltest tests for date-options 2019-06-30 10:38:06 +02:00
Jakob Schöttl
6d0161d742 Add CLI tests for report interval 2019-04-28 10:44:37 +02:00
Simon Michael
6416ad9e54 fix functional test breakage 2019-01-28 20:25:59 -08:00
Felix Yan
9c0648b46a test: fix a typo 2018-10-05 11:06:47 -10:00
Gaith Hallak
bf67823279 Add a test 2018-07-04 17:54:15 +03:00
Simon Michael
e491f513a1 cli: tabular reports no longer have a trailing blank line added
Tabular reports from bal, bs etc. have until now been rendered on
the terminal with one final blank line, for readability.
This change drops the blank line.

This is consistent with the non-tabular balance and register output
(not print, which is a special case), and with most unix commands.
The real reason for it, which I admit is flimsy, is that I can now omit
the final delimiter (>=0) when using shelltestrunner 1.9's new format,
making functional tests easier to maintain and more readable.
If there's opposition, this could be reverted.
2018-01-23 12:47:56 -08:00
Simon Michael
6c60e4a97b bs/cf/is: always show a tabular report, even with no report interval
Previously, if you specified no report interval, the text output of
these commands was a simple report like the original balance command,
with amounts on the left and account names on the right. Also,
balances used arithmetic sign like the balance command.
Now it always draws a table, with account names in the left
column, and shows balances with normal-positive sign, consistent with
the multicolumn reports. Less code, fewer bugs.
2018-01-23 11:05:01 -08:00
Simon Michael
c4b778bfb9 update report titles in func. tests 2018-01-22 07:58:01 -08:00
Simon Michael
80fefe9c43 cli: fix functional tests 2017-09-14 06:14:26 -07:00
Simon Michael
a25a8f868c bs/is: fix tests 2017-07-25 13:23:16 -07:00
Simon Michael
5c09553481 lib: keep amounts aligned when rendering a transaction with posting flags
Related to #563, when rendering a transaction, we reserve two more chars
of width so that amounts remain aligned when there are posting flags.
Affects hledger-ui's transaction screen, print, hledger-rewrite etc.
2017-06-04 21:26:18 -07:00
Simon Michael
5d2f9d742a test: cli: test stderr for more verbose failures 2017-03-29 06:40:39 -07:00
Simon Michael
895a66eb06 cli: first of several cleanups; separate commands list & usage (#297) 2017-03-28 18:44:34 -07:00
Mykola Orliuk
015b764d00 Preserve implicit amounts and prices the way user wrote them in output of print command (#471)
* Remember original postings during infer and pivot

This includes such functions like:
- inferFromAssignment
- inferBalancingAmount
- inferBalancingPrices
- pivotPosting

* Use original postings for hledger print

- Introduce "--explicit" option for "print" command which brings back
  old behavior when every inferred number being printed.
- Make "print" by default print original postings without inferred
  amounts. But use effective account name to have effect from aliases.
- Instruct shell tests with an new expected output or to use
  --explicit option when inferred amounts are checked.

Resolves simonmichael/hledger#442
2017-01-13 07:25:44 -08:00
Simon Michael
3ae8712bbc rename data/ to examples/ 2017-01-08 07:26:13 -08:00
Simon Michael
fe58ef7946 lib: fix typo breaking tests (#438) 2016-12-10 07:13:17 -08:00
Johannes Gerer
45401e538e Balance Assignments and accounts resetting (#438)
* Changed behavior of `readJournalFiles` to be identical to `readJournalFile` for singleton lists

* Balance Assertions have to be simple Amounts

* Add 'isAssignment' and 'assignmentPostings' to Hledger.Data.Posting and Transaction

* Implemented 'balanceTransactionUpdate', a more general version of 'balanceTransaction' that takes an update function

* Fixed test cases.

* Implemented balance assignment ("resetting a balance")

* Add assertions to show function

* updated the comments

* numbering is not needed in journalCheckBalanceAssertions

* remove prices before balance checks

* rename functions
2016-12-10 07:04:48 -08:00
Johannes Gerer
74502f7e50 more general parser types enabling reuse outside of IO (#439) 2016-12-09 15:57:17 -08:00
Simon Michael
20bfceff2e lib: allow multiple files of different format (#320)
When multiple files are specified with multiple -f options, we now
parse each one individually, rather than just concatenating them, so
they can have different formats.

Directives (like default year or account aliases) no longer carry over
from one file to the next. Limitation or feature ?
2016-05-18 16:41:52 -07:00
Simon Michael
1fc34d76f8 cli: adapt func tests pass to new --help 2016-04-19 10:44:43 -07:00
Simon Michael
25cd65442a cli: fix opts parsing regressions from feb
Since commit 7aab544, "-f -" before the command broke command
detection, causing spurious "no such option" errors (and breaking
about 70 functional tests which neither I nor travis noticed).
2016-04-04 11:35:39 -07:00
Simon Michael
21d9945ba9 tests: make functional tests use "hledger" again
Using "hledgerdev" was a hack to help ensure that tests used a fresh
developer build by default. Now they specify "hledger" again, which fits
better with stack. It's up to the tester to make sure the desired
executable is first in PATH or specified with -w. (Note a couple of
tests currently don't obey -w and will always run "hledger", see addons.test).
2015-07-12 12:29:53 -07:00
Imuli
67432f1220 read multiple files: tests 2015-05-28 10:40:48 -07:00
Simon Michael
3669422bbf make --width and --debug require an argument (fixes #149)
This is a workaround for a cmdargs limitation. Having "--debug 2"
or "--width 100" produce no output (because the number is parsed
as a separate argument) is too annoying.
2014-07-03 07:31:52 -07:00
Simon Michael
d1a3516c70 reorganise functional tests by command/topic 2014-05-06 21:02:58 -07:00