git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 1/2] userdiff: tighten word-diff test case of the scheme driver

From
Johannes Sixt via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 15, 2026, 02:27 UTC
Message-ID
<8e0b1e3d013ee379335bc89801525a861047929d.1776220063.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.2000.v4.git.1776220063.gitgitgadget@gmail.com>
From: Johannes Sixt <j6t@kdbg.org>

The scheme driver separates identifiers only at parentheses of all sorts and whitespace, except that vertical bars act as brackets that enclose an identifier.

The test case attempts to demonstrate the vertical bars with a change from 'some-text' to '|a greeting|'. However, this misses the goal because the same word coloring would be applied if '|a greeting|' were parsed as two words.

Have an identifier between vertical bars with a space in both the pre- and the post-image and change only one side of the space to show that the single word exists between the vertical bars.

Also add cases that change parentheses of all kinds in a sequence of parentheses to show that they are their own word each.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Scott L. Burson <Scott@sympoiesis.com>
---
 t/t4034/scheme/expect | 5 +++--
 t/t4034/scheme/post   | 1 +
 t/t4034/scheme/pre    | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/t/t4034/scheme/expect b/t/t4034/scheme/expect
index 496cd5de8c..138abe9f56 100644
--- a/t/t4034/scheme/expect
+++ b/t/t4034/scheme/expect
@@ -2,10 +2,11 @@
 <BOLD>index 74b6605..63b6ac4 100644<RESET>
 <BOLD>--- a/pre<RESET>
 <BOLD>+++ b/post<RESET>
-<CYAN>@@ -1,6 +1,6 @@<RESET>
+<CYAN>@@ -1,7 +1,7 @@<RESET>
 (define (<RED>myfunc a b<RESET><GREEN>my-func first second<RESET>)
   ; This is a <RED>really<RESET><GREEN>(moderately)<RESET> cool function.
   (<RED>this\place<RESET><GREEN>that\place<RESET> (+ 3 4))
-  (define <RED>some-text<RESET><GREEN>|a greeting|<RESET> "hello")
+  (define <RED>|the greeting|<RESET><GREEN>|a greeting|<RESET> "hello")
+  ({<RED>}<RESET>(([<RED>]<RESET>(func-n)<RED>[<RESET>]))<RED>{<RESET>})
   (let ((c (<RED>+ a b<RESET><GREEN>add1 first<RESET>)))
     (format "one more than the total is %d" (<RED>add1<RESET><GREEN>+<RESET> c <GREEN>second<RESET>))))
diff --git a/t/t4034/scheme/post b/t/t4034/scheme/post
index 63b6ac4f87..0e3bab101d 100644
--- a/t/t4034/scheme/post
+++ b/t/t4034/scheme/post
@@ -2,5 +2,6 @@
   ; This is a (moderately) cool function.
   (that\place (+ 3 4))
   (define |a greeting| "hello")
+  ({(([(func-n)]))})
   (let ((c (add1 first)))
     (format "one more than the total is %d" (+ c second))))
diff --git a/t/t4034/scheme/pre b/t/t4034/scheme/pre
index 74b6605357..03d77c7c43 100644
--- a/t/t4034/scheme/pre
+++ b/t/t4034/scheme/pre
@@ -1,6 +1,7 @@
 (define (myfunc a b)
   ; This is a really cool function.
   (this\place (+ 3 4))
-  (define some-text "hello")
+  (define |the greeting| "hello")
+  ({}(([](func-n)[])){})
   (let ((c (+ a b)))
     (format "one more than the total is %d" (add1 c))))
-- 
gitgitgadget
Previous: Scott L. Burson via GitGitGadgetNext: Scott L. Burson via GitGitGadget
Message 25 of 27 in “diff: "lisp" userdiff_driver”
  1. diff: "lisp" userdiff_driverScott L. Burson via GitGitGadget, Nov 15, 2025
  2. Johannes SixtNov 15, 2025
  3. Scott L. BursonNov 15, 2025
  4. D. Ben KnobleNov 20, 2025
  5. Scott L. BursonNov 27, 2025
  6. Junio C HamanoNov 16, 2025
  7. Scott L. BursonNov 17, 2025
  8. Junio C HamanoNov 18, 2025
  9. 0/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Nov 27, 2025
  10. 1/2 diff: "lisp" userdiff_driverScott L. Burson via GitGitGadget, Nov 27, 2025
  11. Scott L. BursonNov 27, 2025
  12. Johannes SixtNov 27, 2025
  13. 2/2 merge with Scheme regexp; fix bugsScott L. Burson via GitGitGadget, Nov 27, 2025
  14. Johannes SixtNov 27, 2025
  15. Johannes SixtDec 2, 2025
  16. Scott L. BursonJan 14, 2026
  17. Johannes SixtJan 14, 2026
  18. 0/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Jan 15, 2026
  19. 1/2 userdiff: tighten word-diff test case of the scheme driverJohannes Sixt via GitGitGadget, Jan 15, 2026
  20. 2/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Jan 15, 2026
  21. Johannes SixtJan 16, 2026
  22. Scott L. BursonJan 17, 2026
  23. Johannes SixtJan 17, 2026
  24. 0/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Apr 15, 2026
  25. 1/2 userdiff: tighten word-diff test case of the scheme driverJohannes Sixt via GitGitGadget, Apr 15, 2026
  26. 2/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Apr 15, 2026
  27. Johannes SixtApr 15, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.