Subject: Re: bug#72721: 31.0.50; Visual-wrap-prefix-mode breaks Magit log buffers

From: Jim Porter <[email-masked]>
Date: Sun, 25 Aug 2024 11:41:40 -0700

On 8/25/2024 10:39 AM, Eli Zaretskii wrote:
>> Date: Sun, 25 Aug 2024 09:26:12 -0700
>> Cc: [email-masked], [email-masked]
>> From: Jim Porter <[email-masked]>
>>
>> Thanks for merging. Everything looks correct to me. I've added a few
>> more test cases to exercise window-specific overlays and they all work
>> the way I'd expect. See attached.
> 
> Thanks.  How about adding these to test/manual/redisplay-testsuite.el?

Do these look ok? It tests everything except window-specific overlays. 
(I could probably add that too, but I'd have to think of a simple way to 
explain to the reader how they should verify the expected results.)

From e36fe56d1e9783e72d4aa70324984dc210159324 Mon Sep 17 00:00:00 2001
From: Jim Porter <[email-masked]>
Date: Sun, 25 Aug 2024 11:37:44 -0700
Subject: [PATCH] Add manual tests for the 'min-width' display property

* test/manual/redisplay-testsuite.el (test-redisplay-5): Add some
newlines.
(test-redisplay-6): New function...
(test-redisplay): ... call it (bug#72721).
---
 test/manual/redisplay-testsuite.el | 56 +++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/test/manual/redisplay-testsuite.el b/test/manual/redisplay-testsuite.el
index 6d1232999ca..0f13c3da417 100644
--- a/test/manual/redisplay-testsuite.el
+++ b/test/manual/redisplay-testsuite.el
@@ -331,7 +331,60 @@ test-redisplay-5
         (test-insert-overlay " " 'display (char-to-string #x3fffc)))
   (insert "\n\n")
   (insert-button "Toggle between octal and hex display"
-                 'action 'test-redisplay-5-toggle))
+                 'action 'test-redisplay-5-toggle)
+  (insert "\n\n"))
+
+(defun test-redisplay-6 ()
+  (insert "Test 6: min-width display property:\n\n")
+  (insert "  Expected: 123  45\n")
+  (insert "  Results:  "
+          (propertize "123" 'display '((min-width (5))))
+          "45")
+  (insert "\n\n")
+  (insert "  Expected: 12  34  5\n")
+  (insert "  Results:  "
+          (propertize "12" 'display '((min-width (4))))
+          (propertize "34" 'display '((min-width (4))))
+          "5")
+  (insert "\n\n")
+  (insert "  Expected: 1gnu  45\n")
+  (insert "  Results:  "
+          "1"
+          (propertize "23" 'display
+                      (propertize "gnu" 'display '((min-width (5)))))
+          "45")
+  (insert "\n\n")
+  (insert "  Expected: 123  45\n")
+  (insert "  Results:  ")
+  (test-insert-overlay "123" 'display '((min-width (5))))
+  (insert "45")
+  (insert "\n\n")
+  (insert "  Expected: 1_23 45\n")
+  (insert "  Results:  ")
+  (insert (propertize "123" 'display '((min-width (5)))))
+  (let ((overlay (make-overlay (- (point) 1) (- (point) 2))))
+    (overlay-put overlay 'before-string "_"))
+  (insert "45")
+  (insert "\n\n")
+  (insert (propertize "_" 'display '(left-fringe large-circle))
+          "  Expected: 123  45\n")
+  (insert "  Results:  ")
+  (insert (propertize "123" 'display '((min-width (5)))))
+  (let ((overlay (make-overlay (- (point) 2) (- (point) 1))))
+    (overlay-put overlay 'before-string
+                 (propertize "_" 'display '(left-fringe large-circle))))
+  (insert "45")
+  (insert "\n\n")
+  (insert (propertize "_" 'display '(left-fringe large-circle))
+          "  Expected: 123  45\n")
+  (insert "  Results:  ")
+  (insert (propertize "123" 'display '((min-width (5)))))
+  (let ((overlay1 (make-overlay (- (point) 3) (point)))
+        (overlay2 (make-overlay (- (point) 2) (- (point) 1))))
+    (overlay-put overlay1 'display '((min-width (5))))
+    (overlay-put overlay2 'before-string
+                 (propertize "_" 'display '(left-fringe large-circle))))
+  (insert "45"))
 
 (defun test-redisplay ()
   (interactive)
@@ -349,6 +402,7 @@ test-redisplay
     (test-redisplay-3)
     (test-redisplay-4)
     (test-redisplay-5)
+    (test-redisplay-6)
     (goto-char (point-min))))
 
 ;;; redisplay-testsuite.el ends here
-- 
2.25.1