[test-balsheet-pnl] tests reverse-chrono option

This commit is contained in:
Christopher Lam 2020-12-13 07:12:17 +08:00
parent 200d4d8e2e
commit cf5db5cff5

View File

@ -541,6 +541,15 @@
"1 FUNDS $350.0000")
(sxml->table-row-col sxml 1 #f 4)))
(set-option! multi-bs-options "General" "Period order is most recent first" #t)
(let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
"multicol-balsheet-halfyear")))
(test-equal "bal-1/1/70-reverse-chrono"
'("Date" "01/01/72" "01/01/71" "01/01/70")
(sxml->table-row-col sxml 1 1 #f)))
(set-option! multi-bs-options "General" "Period order is most recent first" #f)
;; the following includes non-zero retained earnings of $1,270
(set-option! multi-bs-options "General" "End Date"
(cons 'absolute (gnc-dmy2time64 1 3 1980)))
@ -599,4 +608,11 @@
(test-equal "pnl-3/80"
'("03/01/80" " to 03/31/80" "$0.00" "$0.00" "$0.00" "#0.00 "
"$0.00" "#1.00 $1.7000")
(sxml->table-row-col sxml 1 #f 4)))))
(sxml->table-row-col sxml 1 #f 4)))
(set-option! multi-bs-options "General" "Period order is most recent first" #t)
(let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
"testing period reverse chrono order pnl")))
(test-equal "pnl-reverse chrono"
'("Date" "03/31/80" "03/01/80" "02/01/80" "01/01/80")
(sxml->table-row-col sxml 1 1 #f)))))