summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2023-11-17 13:55:07 +0000
committerArun Isaac2023-11-17 13:55:07 +0000
commitb1cff95e0360f7db8391763bba334aaac595dd41 (patch)
tree4a0bad34ba7e868311bbca8041a7b4e2468fdea4 /tests
parent19b9decada9b18b85e4197d0bc395389cba76fc3 (diff)
downloadccwl-b1cff95e0360f7db8391763bba334aaac595dd41.tar.gz
ccwl-b1cff95e0360f7db8391763bba334aaac595dd41.tar.lz
ccwl-b1cff95e0360f7db8391763bba334aaac595dd41.zip
ui: Colorize format specifiers not format arguments.
* ccwl/ui.scm (report-formatted-message): Colorize format specifiers not format arguments. * tests/ui.scm ("report-formatted-message must not fail on arguments that are not strings"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/ui.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/ui.scm b/tests/ui.scm
index 4189e6c..a5741c0 100644
--- a/tests/ui.scm
+++ b/tests/ui.scm
@@ -17,7 +17,9 @@
;;; along with ccwl. If not, see <https://www.gnu.org/licenses/>.
(use-modules (srfi srfi-64)
- (term ansi-color))
+ (term ansi-color)
+ (ccwl ui)
+ (ccwl conditions))
(define source-in-context
(@@ (ccwl ui) source-in-context))
@@ -43,4 +45,12 @@
(call-with-input-string "(foo (bar))"
(cut source-in-context <> 0 5)))
+(test-assert "report-formatted-message must not fail on arguments that are not strings"
+ (call-with-output-string
+ (lambda (port)
+ (with-error-to-port port
+ (lambda ()
+ (report-formatted-message
+ (formatted-message "Foo ~a" 'bar)))))))
+
(test-end "ui")