From 458011fbb95610d1afbcc077df938213e7426582 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 6 Nov 2023 15:39:06 +0000 Subject: ui: Do not attempt to display the line preceding the 0th. * ccwl/ui.scm (source-in-context): Do not attempt to display the line preceding the 0th. * tests/ui.scm ("display source in context on 0th line"): New line. --- tests/ui.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/ui.scm b/tests/ui.scm index f7810d7..4189e6c 100644 --- a/tests/ui.scm +++ b/tests/ui.scm @@ -35,4 +35,12 @@ " (cut source-in-context <> 1 2))) +(test-equal "display source in context on 0th line" + (string-append "(foo " + (colorize-string "(bar)" 'BOLD 'RED) + ") +") + (call-with-input-string "(foo (bar))" + (cut source-in-context <> 0 5))) + (test-end "ui") -- cgit v1.2.3