mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-16 18:25:11 -06:00
[test-cash-flow] fix test which was badly designed
this test had confused 2 functions: (exchange-fn monetary currency) --> monetary and (to-report-currency currency amount date) --> amount this flaw surfaces with the shortened gnc:sum-collector-commodity definition.
This commit is contained in:
parent
4214f7eb76
commit
dd1873eb05
@ -23,6 +23,10 @@
|
||||
(new-secs (- t64 day-secs)))
|
||||
new-secs))
|
||||
|
||||
(define (to-report-currency curr amt date) amt)
|
||||
|
||||
(define (exchange-fn mon comm) mon)
|
||||
|
||||
(define (test-one-tx-in-cash-flow)
|
||||
(let* ((env (create-test-env))
|
||||
(account-alist (env-create-account-structure-alist env structure))
|
||||
@ -32,7 +36,6 @@
|
||||
(today (gnc-localtime (current-time)))
|
||||
(to-date-t64 (gnc-dmy2time64-end (tm:mday today) (+ 1 (tm:mon today)) (+ 1900 (tm:year today))))
|
||||
(from-date-t64 (NDayDelta to-date-t64 1))
|
||||
(exchange-fn (lambda (currency amount date) amount))
|
||||
(report-currency (gnc-default-report-currency))
|
||||
)
|
||||
(env-create-transaction env to-date-t64 bank-account expense-account 100/1)
|
||||
@ -41,7 +44,7 @@
|
||||
(cons 'from-date-t64 from-date-t64)
|
||||
(cons 'report-currency report-currency)
|
||||
(cons 'include-trading-accounts #f)
|
||||
(cons 'to-report-currency exchange-fn)))))
|
||||
(cons 'to-report-currency to-report-currency)))))
|
||||
(let* ((money-in-collector (cdr (assq 'money-in-collector result)))
|
||||
(money-out-collector (cdr (assq 'money-out-collector result)))
|
||||
(money-in-alist (cdr (assq 'money-in-alist result)))
|
||||
@ -76,7 +79,6 @@
|
||||
(today (gnc-localtime (current-time)))
|
||||
(to-date-t64 (gnc-dmy2time64-end (tm:mday today) (+ 1 (tm:mon today)) (+ 1900 (tm:year today))))
|
||||
(from-date-t64 (NDayDelta to-date-t64 1))
|
||||
(exchange-fn (lambda (currency amount date) amount))
|
||||
(report-currency (gnc-default-report-currency))
|
||||
)
|
||||
(env-create-transaction env to-date-t64 bank-account wallet-account 100/1)
|
||||
@ -85,7 +87,7 @@
|
||||
(cons 'from-date-t64 from-date-t64)
|
||||
(cons 'report-currency report-currency)
|
||||
(cons 'include-trading-accounts #f)
|
||||
(cons 'to-report-currency exchange-fn)))))
|
||||
(cons 'to-report-currency to-report-currency)))))
|
||||
(let* ((money-in-collector (cdr (assq 'money-in-collector result)))
|
||||
(money-out-collector (cdr (assq 'money-out-collector result)))
|
||||
(money-in-alist (cdr (assq 'money-in-alist result)))
|
||||
@ -110,7 +112,6 @@
|
||||
(today (gnc-localtime (current-time)))
|
||||
(to-date-t64 (gnc-dmy2time64-end (tm:mday today) (+ 1 (tm:mon today)) (+ 1900 (tm:year today))))
|
||||
(from-date-t64 (NDayDelta to-date-t64 1))
|
||||
(exchange-fn (lambda (currency amount date) amount))
|
||||
(report-currency (gnc-default-report-currency))
|
||||
)
|
||||
(env-create-transaction env to-date-t64 bank-account expense-account 100/1)
|
||||
@ -120,7 +121,7 @@
|
||||
(cons 'from-date-t64 from-date-t64)
|
||||
(cons 'report-currency report-currency)
|
||||
(cons 'include-trading-accounts #f)
|
||||
(cons 'to-report-currency exchange-fn)))))
|
||||
(cons 'to-report-currency to-report-currency)))))
|
||||
(let* ((money-in-collector (cdr (assq 'money-in-collector result)))
|
||||
(money-out-collector (cdr (assq 'money-out-collector result)))
|
||||
(money-in-alist (cdr (assq 'money-in-alist result)))
|
||||
|
Loading…
Reference in New Issue
Block a user