test-report-utilities.scm (gnucash-5.0.tar.bz2) | : | test-report-utilities.scm (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 53 | skipping to change at line 53 | |||
(test-day (tm:mday ts-now)) | (test-day (tm:mday ts-now)) | |||
(test-month (+ 1 (tm:mon ts-now))) | (test-month (+ 1 (tm:mon ts-now))) | |||
(test-year (+ 1900 (tm:year ts-now))) | (test-year (+ 1900 (tm:year ts-now))) | |||
(end-date (gnc-dmy2time64 test-day test-month test-year)) | (end-date (gnc-dmy2time64 test-day test-month test-year)) | |||
(start-date (NDayDelta end-date 10)) | (start-date (NDayDelta end-date 10)) | |||
(q-end-date (gnc-dmy2time64-end test-day test-month test-year)) | (q-end-date (gnc-dmy2time64-end test-day test-month test-year)) | |||
(q-start-date (gnc-dmy2time64 test-day test-month test-year)) | (q-start-date (gnc-dmy2time64 test-day test-month test-year)) | |||
(q-start-date (NDayDelta q-start-date 5))) | (q-start-date (NDayDelta q-start-date 5))) | |||
(let* ((accounts (env-create-account-structure-alist env (list "Assets" | (let* ((accounts (env-create-account-structure-alist env (list "Assets" | |||
(list (cons 't | (list (cons ' | |||
ype ACCT-TYPE-ASSET)) | type ACCT-TYPE-ASSET)) | |||
(list "Bank Ac | (list "Bank A | |||
count") | ccount") | |||
(list "Wallet" | (list "Wallet | |||
)))) | ")))) | |||
(bank-account (cdr (assoc "Bank Account" accounts))) | (bank-account (cdr (assoc "Bank Account" accounts))) | |||
(wallet (cdr (assoc "Wallet" accounts)))) | (wallet (cdr (assoc "Wallet" accounts)))) | |||
(env-create-daily-transactions env start-date end-date bank-account wallet ) | (env-create-daily-transactions env start-date end-date bank-account wallet ) | |||
(format #t "Created transactions for each day from ~a to ~a~%" (gnc-ctime start-date) (gnc-ctime end-date)) | (format #t "Created transactions for each day from ~a to ~a~%" (gnc-ctime start-date) (gnc-ctime end-date)) | |||
(let ((splits (gnc:account-get-trans-type-splits-interval (list bank-accou nt wallet) | (let ((splits (gnc:account-get-trans-type-splits-interval (list bank-accou nt wallet) | |||
ACCT-TYPE-ASSET | ACCT-TYPE-ASSET | |||
q-start-date q-end- | q-start-date q-end | |||
date))) | -date))) | |||
;; 10 is the right number (5 days, two splits per tx) | ;; 10 is the right number (5 days, two splits per tx) | |||
(test-equal "length splits = 10" | (test-equal "length splits = 10" | |||
10 | 10 | |||
(length splits))))) | (length splits))))) | |||
(teardown))) | (teardown))) | |||
(define (teardown) | (define (teardown) | |||
(gnc-clear-current-session)) | (gnc-clear-current-session)) | |||
(define (test-list-ref-safe) | (define (test-list-ref-safe) | |||
(test-begin "list-ref-safe") | (test-begin "list-ref-safe") | |||
(let ((lst '(1 2))) | (let ((lst '(1 2))) | |||
skipping to change at line 264 | skipping to change at line 264 | |||
;; the following tests whether commodity-collector rounds | ;; the following tests whether commodity-collector rounds | |||
;; inappropriately | ;; inappropriately | |||
(coll-A 'reset #f #f) | (coll-A 'reset #f #f) | |||
(coll-A 'add GBP 1/3) | (coll-A 'add GBP 1/3) | |||
(coll-A 'add GBP 1/3) | (coll-A 'add GBP 1/3) | |||
(coll-A 'add GBP 1/3) | (coll-A 'add GBP 1/3) | |||
(coll-A 'add GBP -1) | (coll-A 'add GBP -1) | |||
(test-equal "gnc-commodity-collector does not round inappropriately" | (test-equal "gnc-commodity-collector does not round inappropriately" | |||
'(("GBP" . 0)) | '(("GBP" . 0)) | |||
(collector->list coll-A)) | ||||
;; the following tests the remove-zeros action | ||||
(coll-A 'add USD 1) | ||||
(coll-A 'add EUR 0) | ||||
(test-equal "gnc-commodity-collector before remove-zeros" | ||||
'(("EUR" . 0) ("USD" . 1) ("GBP" . 0)) | ||||
(collector->list coll-A)) | ||||
(coll-A 'remove-zeros #f #f) | ||||
(test-equal "gnc-commodity-collector after remove-zeros" | ||||
'(("USD" . 1)) | ||||
(collector->list coll-A))) | (collector->list coll-A))) | |||
(teardown))) | (teardown))) | |||
(define (mnemonic->commodity sym) | (define (mnemonic->commodity sym) | |||
(gnc-commodity-table-lookup | (gnc-commodity-table-lookup | |||
(gnc-commodity-table-get-table (gnc-get-current-book)) | (gnc-commodity-table-get-table (gnc-get-current-book)) | |||
(gnc-commodity-get-namespace (gnc-default-report-currency)) | (gnc-commodity-get-namespace (gnc-default-report-currency)) | |||
sym)) | sym)) | |||
(define (structure) | (define (structure) | |||
End of changes. 3 change blocks. | ||||
13 lines changed or deleted | 24 lines changed or added |