From c135c1a3fc083e8480f2ef38b9590bb57cdacb66 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 19 Aug 2021 17:43:45 -1000 Subject: [PATCH] ;cln: slight typos cleanup (#1654) --- hledger-lib/Hledger/Data/Amount.hs | 3 ++- hledger/test/balance/commodity-column.test | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hledger-lib/Hledger/Data/Amount.hs b/hledger-lib/Hledger/Data/Amount.hs index 445726795..11f814062 100644 --- a/hledger-lib/Hledger/Data/Amount.hs +++ b/hledger-lib/Hledger/Data/Amount.hs @@ -664,7 +664,8 @@ amounts (Mixed ma) amountsRaw :: MixedAmount -> [Amount] amountsRaw (Mixed ma) = toList ma --- | Get the set of mixed amount commodities. Returns an empty set of no amounts +-- | Get this mixed amount's commodities as a set. +-- Returns an empty set if there are no amounts. maCommodities :: MixedAmount -> S.Set CommoditySymbol maCommodities = S.fromList . fmap acommodity . amounts' where amounts' ma@(Mixed m) = if M.null m then [] else amounts ma diff --git a/hledger/test/balance/commodity-column.test b/hledger/test/balance/commodity-column.test index 38edb4155..2c1ac491e 100644 --- a/hledger/test/balance/commodity-column.test +++ b/hledger/test/balance/commodity-column.test @@ -9,7 +9,7 @@ $ hledger -f bcexample.hledger bal assets.*etrade -3 -O csv "total","70.00 GLD, 17.00 ITOT, 5120.50 USD, 36.00 VEA, 294.00 VHT" >=0 -# 2. Balance report csv output with one line per commodity (--commodity-columns). +# 2. Balance report csv output with one line per commodity (--commodity-column). $ hledger -f bcexample.hledger bal assets.*etrade -3 -O csv --commodity-column > "account","commodity","balance" @@ -65,7 +65,7 @@ $ hledger -f bcexample.hledger bal -T -Y assets.*etrade -3 -O csv "total","10.00 ITOT, 337.18 USD, 12.00 VEA, 106.00 VHT","70.00 GLD, 18.00 ITOT, -98.12 USD, 10.00 VEA, 18.00 VHT","-11.00 ITOT, 4881.44 USD, 14.00 VEA, 170.00 VHT","70.00 GLD, 17.00 ITOT, 5120.50 USD, 36.00 VEA, 294.00 VHT" >=0 -# 6. Multicolumn balance report csv output with --commodity-columns. +# 6. Multicolumn balance report csv output with --commodity-column. $ hledger -f bcexample.hledger bal -T -Y assets.*etrade -3 -O csv --commodity-column > "account","commodity","2012","2013","2014","total" @@ -95,7 +95,7 @@ Balance changes in 2012-01-01..2014-12-31: Assets:US:ETrade || VHT 106.00 18.00 170.00 98.00 >=0 -# 8. Multicolumn budget report csv output with --commodity-columns. +# 8. Multicolumn budget report csv output with --commodity-column. $ hledger -f bcexample.hledger bal -Y assets.*etrade -3 -O csv --commodity-column --budget > "Account","Commodity","2012","budget","2013","budget","2014","budget" @@ -147,7 +147,7 @@ Balance changes in 2012-01-01..2014-12-31: Average || 23.33 5.67 1706.83 12.00 98.00 | 23.33 5.67 1706.83 12.00 98.00 >=0 -# 11. Multicolumn balance report with --commodity-column --transpose. +# 11. Multicolumn budget report with --commodity-column --transpose. < ~ daily from 2016/1/1 expenses:food $10