gnucash/libgnucash/app-utils/test/test-options.scm
Geert Janssens c00bf6bcdb app-utils - expose wrapped api directly from app-utils.scm
With that in place we no longer need to (gnc:module-load "gnucash/app-utils" 0)
the app-utils gncmodule. An ordinary (use-modules (gnucash app-utils)) suffices
2019-12-06 20:38:20 +01:00

28 lines
825 B
Scheme

(use-modules (gnucash app-utils))
(use-modules (srfi srfi-64))
(use-modules (tests srfi64-extras))
(define (run-test)
(test-runner-factory gnc:test-runner)
(test-begin "test-options")
(test-lookup-option)
(test-end "test-options"))
(define (test-lookup-option)
(let ((options (gnc:new-options)))
(gnc:register-option
options
(gnc:make-simple-boolean-option
"Section" "Start Date" "sort-tag" "docstring" 'default-val))
(gnc:register-option
options
(gnc:make-simple-boolean-option
"Filter" "Void Transactions" "sort-tag" "docstring" 'default-val))
(test-assert "lookup-option changed name"
(gnc:lookup-option options "Section" "From"))
(test-assert "lookup-option changed section and name"
(gnc:lookup-option options "Section" "Void Transactions?"))))