mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[test-transaction] add tests for gnc:lists->csv
This commit is contained in:
parent
c02e23bd96
commit
c642980456
@ -67,6 +67,7 @@
|
||||
(test-begin "transaction.scm")
|
||||
(null-test)
|
||||
(trep-tests)
|
||||
(csv-tests)
|
||||
(reconcile-tests)
|
||||
;; (test-end) must be run as the last function, it will
|
||||
;; return #f if any of the tests have failed.
|
||||
@ -928,6 +929,30 @@
|
||||
(gnc:html-document-export-string document))))
|
||||
(test-end "csv-export")))
|
||||
|
||||
(define (csv-tests)
|
||||
(test-begin "csv tests")
|
||||
(test-equal "gnc:lists->csv empty"
|
||||
""
|
||||
(gnc:lists->csv '(())))
|
||||
(test-equal "gnc:lists->csv simple"
|
||||
"\"from\",\"01/01/2010\""
|
||||
(gnc:lists->csv
|
||||
'(("from" "01/01/2010"))))
|
||||
(test-equal "gnc:lists->csv complex"
|
||||
"\"from\",\"01/01/2010\",,,
|
||||
\"to\",\"31/12/2010\",,,
|
||||
\"total\",23500.0,30000.0,3.5714285714285716,sym"
|
||||
(gnc:lists->csv
|
||||
'(("from" "01/01/2010")
|
||||
("to" "31/12/2010")
|
||||
("total" 23500 30000 25/7 sym))))
|
||||
(test-error "gnc:lists->csv improper list"
|
||||
(gnc:lists->csv
|
||||
'(("from" "01/01/2010")
|
||||
("to" "31/12/2010")
|
||||
("total" 23500 30000 25/7 . sym))))
|
||||
(test-end "csv tests"))
|
||||
|
||||
(define (reconcile-tests)
|
||||
(let* ((env (create-test-env))
|
||||
(account-alist (env-create-account-structure-alist env structure))
|
||||
|
Loading…
Reference in New Issue
Block a user