diff --git a/lib/chibi/show-test.sld b/lib/chibi/show-test.sld index dff1efaa..8880ac14 100644 --- a/lib/chibi/show-test.sld +++ b/lib/chibi/show-test.sld @@ -733,12 +733,16 @@ def | 6 (test "\x1B;[31mred\x1B;[0m" (show #f (as-red "red"))) (test "\x1B;[31mred\x1B;[34mblue\x1B;[31mred\x1B;[0m" (show #f (as-red "red" (as-blue "blue") "red"))) + (test "\x1b;[31m1234567\x1b;[0m col: 7" + (show #f (as-unicode (as-red "1234567") (fn ((col)) (each " col: " col))))) ;; unicode (test "〜日本語〜" (show #f (with ((pad-char #\〜)) (padded/both 5 "日本語")))) (test "日本語" (show #f (as-unicode (with ((pad-char #\〜)) (padded/both 5 "日本語"))))) + (test "日本語 col: 6" + (show #f (as-unicode "日本語" (fn ((col)) (each " col: " col))))) ;; from-file ;; for reference, filesystem-test relies on creating files under /tmp diff --git a/lib/chibi/show/color.scm b/lib/chibi/show/color.scm index b21222d0..7a324e12 100644 --- a/lib/chibi/show/color.scm +++ b/lib/chibi/show/color.scm @@ -18,7 +18,7 @@ (else "0"))) (define (ansi-escape color) - (each (integer->char 27) "[" (color->ansi color) "m")) + (string-append (string (integer->char 27)) "[" (color->ansi color) "m")) (define (colored new-color . args) (fn (color)