Merge branch 'maint'

This commit is contained in:
Frank H. Ellenberger
2023-01-22 11:25:44 +01:00
10 changed files with 76 additions and 69 deletions

View File

@@ -111,7 +111,7 @@
(set-exception-printer! 'unbound-variable print-unbound-variable-error)
;; format.
(define %regex (make-regexp "[$][{]([[:alnum:]]+)[}]"))
(define %regex (make-regexp "[$][{]([[:alnum:]\\-]+)[}]"))
(define (gnc:format str . bindings)
(define hash (make-hash-table))
(define (substitute m)

View File

@@ -30,6 +30,10 @@
"basic test"
(gnc:format "basic ${job}" 'job "test"))
(test-equal "one substitution with hyphen"
"master chief"
(gnc:format "master ${job-title}" 'job-title "chief"))
(test-equal "two substitutions out of order"
"basic test"
(gnc:format "${difficulty} ${job}" 'job "test" 'difficulty "basic"))