From e3f1be57b15f44abefe79e7da29c51d057ec7b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 27 Oct 2023 16:22:46 +0200 Subject: Add some tests for vulgar. --- tests/unit/vulgar/color.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/unit/vulgar/color.scm (limited to 'tests/unit/vulgar/color.scm') diff --git a/tests/unit/vulgar/color.scm b/tests/unit/vulgar/color.scm new file mode 100644 index 00000000..1dd2b4f3 --- /dev/null +++ b/tests/unit/vulgar/color.scm @@ -0,0 +1,13 @@ +(define-module (test vulgar-color) + :use-module (srfi srfi-64) + :use-module (srfi srfi-88) + :use-module (vulgar color)) + +(test-equal "No color" "" (color-escape #f)) + +;;; Extra with-output-to-string so escape sequences are escaped in error diff. +(test-equal "Color" + (with-output-to-string (lambda () (write "\x1b[38;2;16;32;48m"))) + (with-output-to-string (lambda () (write (color-escape "#102030"))))) + +'((vulgar color)) -- cgit v1.2.3