Skip to content

Commit 24012f6

Browse files
committed
userdiff: tighten word-diff test case of the scheme driver
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>
1 parent 8745eae commit 24012f6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

t/t4034/scheme/expect

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
<BOLD>index 74b6605..63b6ac4 100644<RESET>
33
<BOLD>--- a/pre<RESET>
44
<BOLD>+++ b/post<RESET>
5-
<CYAN>@@ -1,6 +1,6 @@<RESET>
5+
<CYAN>@@ -1,7 +1,7 @@<RESET>
66
(define (<RED>myfunc a b<RESET><GREEN>my-func first second<RESET>)
77
; This is a <RED>really<RESET><GREEN>(moderately)<RESET> cool function.
88
(<RED>this\place<RESET><GREEN>that\place<RESET> (+ 3 4))
9-
(define <RED>some-text<RESET><GREEN>|a greeting|<RESET> "hello")
9+
(define <RED>|the greeting|<RESET><GREEN>|a greeting|<RESET> "hello")
10+
({<RED>}<RESET>(([<RED>]<RESET>(func-n)<RED>[<RESET>]))<RED>{<RESET>})
1011
(let ((c (<RED>+ a b<RESET><GREEN>add1 first<RESET>)))
1112
(format "one more than the total is %d" (<RED>add1<RESET><GREEN>+<RESET> c <GREEN>second<RESET>))))

t/t4034/scheme/post

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
; This is a (moderately) cool function.
33
(that\place (+ 3 4))
44
(define |a greeting| "hello")
5+
({(([(func-n)]))})
56
(let ((c (add1 first)))
67
(format "one more than the total is %d" (+ c second))))

t/t4034/scheme/pre

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(define (myfunc a b)
22
; This is a really cool function.
33
(this\place (+ 3 4))
4-
(define some-text "hello")
4+
(define |the greeting| "hello")
5+
({}(([](func-n)[])){})
56
(let ((c (+ a b)))
67
(format "one more than the total is %d" (add1 c))))

0 commit comments

Comments
 (0)