Commit Graph

6547 Commits

Author SHA1 Message Date
Simon Michael
50d666d5a0 test: refactor, document, organise easytests, port amountp tests (#812) 2018-08-15 19:58:07 +01:00
Simon Michael
717a24a76d fix unit tests func test 2018-08-15 12:03:13 +01:00
Simon Michael
69325da110 comment out failing tests to fix CI (#812) 2018-08-15 11:30:53 +01:00
Simon Michael
77ad384fcd tools: make: tweak quotes for easier copy/paste 2018-08-15 11:24:52 +01:00
Simon Michael
ed15ebd70e test: run some easytests as well; print test output on stdout 2018-08-15 11:24:52 +01:00
Simon Michael
ab7dc3294e lib: more informative failure output for amount tests (#812) 2018-08-15 11:24:52 +01:00
Simon Michael
e6181efe95 lib: more compact show instance for Amounts (#812)
Amount's default show instance hid important details, making eg test
failures hard to understand. Showing full detail required increasing
the debug level which was inconvenient.

Now it has a single show instance which shows more information, is
fairly compact, and is pretty-printable with pretty-show.
Ellipses (..) in the output indicate where fields are
- not shown in full detail, and/or
- shown in pseudo syntax (double quoted) to work with pretty-show.

ghci> usd 1
OLD:
Amount {acommodity="$", aquantity=1.00, ..}
NEW:
Amount {acommodity = "$", aquantity = 1.00, aprice = NoPrice, astyle = AmountStyle "L False 2 Just '.' Nothing..", amultiplier = False}

MixedAmount's show instance is unchanged, but showMixedAmountDebug
is affected by this change:

ghci> putStrLn $ showMixedAmountDebug $ Mixed [usd 1]
OLD:
Mixed [Amount {acommodity="$", aquantity=1.00, aprice=, astyle=AmountStyle {ascommodityside = L, ascommodityspaced = False, asprecision = 2, asdecimalpoint = Just '.', asdigitgroups = Nothing}}]
NEW:
Mixed [Amount {acommodity="$", aquantity=1.00, aprice=, astyle=AmountStyle "L False 2 Just '.' Nothing.."}]
2018-08-15 11:18:55 +01:00
Simon Michael
f47a617dcc journal: commented test for D and auto postings (#860)
[ci skip]
2018-08-15 10:32:10 +01:00
Simon Michael
4c268f4a93 doc: journal: fix Transaction Modifiers formatting
[ci skip]
2018-08-14 16:07:26 +01:00
Simon Michael
681039b387 doc: journal: fix Transaction Modifiers heading
[ci skip]
2018-08-14 16:05:06 +01:00
Simon Michael
27d464f344 lib: some helpers for setting Amount internals (#812) 2018-08-14 16:05:06 +01:00
Simon Michael
efae8f8f2a lib: comment 2018-08-14 16:05:06 +01:00
Simon Michael
e077aeff5f lib: more informative test failure message (#812) 2018-08-14 16:05:06 +01:00
Simon Michael
321635274c lib: move assertParseEqual' (#812) 2018-08-14 16:05:06 +01:00
Simon Michael
ebe2d52965 tools: make functest: build hledger and test that, without installing 2018-08-14 16:05:06 +01:00
Simon Michael
b03584dbce lib: parse helper haddocks 2018-08-14 16:05:06 +01:00
Simon Michael
cfaa0501e6 lib: update some journal parser tests (#812) 2018-08-14 16:05:06 +01:00
Jakub Zárybnický
c67404c73d lib: Fix compile errors in tests 2018-08-14 16:05:06 +01:00
Simon Michael
510b4c1b55 site: home: update from wiki
[ci skip]
2018-08-05 00:00:03 -07:00
Simon Michael
e88a9c4a5f lib: followingcomment: parse no comment as "", not "\n"
Same-line & next-line comments of transactions, postings, etc.
are now parsed a bit more precisely. Previously parsing no comment
gave the same result as an empty comment (a single newline); now
it gives an empty string.

Also, and perhaps as a consequence of the above, when there's no
same-line comment but there is a next-line comment, we'll insert an
empty first line, otherwise next-line comments would get moved up to
the same line when rendered.

Some doctests have been added.
2018-08-03 19:38:55 +01:00
Simon Michael
46d6971da7 lib: doctests: file pattern arguments, more informative output
Limiting to just the file(s) you're interested can make doctest start
much quicker. With a big caveat: you can limit the starting files,
but it will also test all other local files those import.
2018-08-03 19:06:17 +01:00
Simon Michael
df430e5eb0 lib: AccountName: set OverloadedStrings for doctests 2018-08-03 19:05:14 +01:00
Simon Michael
ed93807ee5 lib: doctests: add --verbose and --slow flags to executable
--slow turns off doctest's --fast flag, which skips reloading between
  tests.
--verbose shows progress output as tests are run, if doctest 0.16.0+
  is installed (and I believe will be harmless otherwise)
2018-08-03 19:05:14 +01:00
Simon Michael
8a4fb59aaa tools: make ghci-doctest: fix rule help 2018-08-03 19:05:14 +01:00
Simon Michael
0135f8c863 tools: make doctest: use default snapshot/ghc 8.4, mention mac workaround 2018-08-03 19:05:11 +01:00
Simon Michael
e10ab0f7f7 tools: make functest: also run unit tests
The main unit tests are now included in the functional test suite
(via hledger's test command), so make functest covers more.

[ci skip]
2018-08-03 15:16:59 +01:00
Simon Michael
b11a0eadb2 make these modules loadable in a GHCI with OverloadedStrings set 2018-08-03 14:52:11 +01:00
Simon Michael
3e0147b7e9 test: don't try to read the journal 2018-08-03 14:52:11 +01:00
Joseph Weston
40d70ad10b lib: fail when file to include is in stack of 'include' files 2018-08-02 18:43:00 +01:00
Joseph Weston
1d91ea43a5 lib: add whitespace around '$' operator 2018-08-02 18:43:00 +01:00
Simon Michael
86c36c1dcc update embedded manuals 2018-08-02 08:25:49 +01:00
Simon Michael
481e2061d7 doc: journal: tweak mnemonics 2018-08-02 08:25:49 +01:00
Simon Michael
64bd88dd80 doc: journal: rename topic to Transaction Modifiers 2018-08-02 08:25:49 +01:00
Simon Michael
d685d1aa9b lib,rewrite: simplify transactionModifierToFunction
This removes transactionModifierToFunction's extra query parameter;
the rewrite command sets it in the TransactionModifier instead, which
I think is equivalent. I had to change one functional test, but it
seems correct now, so perhaps it wasn't working right before ?
2018-08-02 08:25:49 +01:00
Simon Michael
72acb86299 cabal: bump tested-with declarations 2018-08-02 08:25:49 +01:00
Simon Michael
1e0a7ec8f1 remove some unneeded CPP pragmas 2018-08-02 08:25:49 +01:00
Simon Michael
9bd1772ea8 bs/bse/cf/is: remove NoCPP pragma
This was added in 2012, I guess to prevent CPP breaking on some
needed and I don't want to do this everywhere; we'll just remember
to not put CPP-like content in quasi-quoted blocks.
2018-08-02 08:25:49 +01:00
Simon Michael
a4ed468979 don't re-export applyTransactionModifiers from Hledger.Cli.Utils, I guess 2018-08-02 08:25:49 +01:00
Simon Michael
eae9d78bb1 lib: generateAutomaticPostings -> applyTransactionModifiers 2018-08-02 08:25:49 +01:00
Simon Michael
bb36693155 lib: refactor, txnTieKnot automatically 2018-08-02 08:25:49 +01:00
Simon Michael
572f5a4b31 lib: drop parseAndFinaliseJournal', seems unused (api change) 2018-08-02 08:25:49 +01:00
Simon Michael
ebfdee878c site: home: fix coins image when previewing locally
[ci skip]
2018-07-31 15:24:17 +01:00
Simon Michael
f5f26ea8e5 doc: download: link Greg Baker's OpenBSD binaries
[ci skip]
2018-07-31 15:23:51 +01:00
Simon Michael
a49b1cd3bb lib: AutoTransaction.hs -> TransactionModifier.hs, PeriodicTransaction.hs 2018-07-30 20:22:39 +01:00
Simon Michael
efc54c4c25 lib: ModifierTransaction -> TransactionModifier; try to clarify a bit 2018-07-30 19:38:21 +01:00
Simon Michael
007b9f8caa lib: capitalised month names broke some period expressions (fix #852)
This was a regression in hledger 1.10.
mon[th]Index are now case insensitive.
2018-07-30 11:08:23 +01:00
Simon Michael
daa37a9993 lib: nthdayof(month|year)containing now validate input a bit (#852) 2018-07-30 11:08:14 +01:00
Simon Michael
0f3a030a40 lib: whitespace 2018-07-30 11:05:02 +01:00
Simon Michael
eb6baac6e7 lib: make applyN more robust (#852) 2018-07-30 11:04:33 +01:00
Simon Michael
d9d94e2cf6 journal: fix breakage in auto posting rule parser (#745)
I was negligent and did not test enough. This should ignore
transaction comments in auto posting rules more safely.
It also adds support for trailing comments on the first line of auto
posting rules, which previously were misparsed as part of the query.
2018-07-26 15:54:21 +01:00