From b1aa6146ba6a3e8b11a84570a18184a280c84eec Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 28 Jan 2024 07:59:45 -0600 Subject: [PATCH] add a test case for the fix in racket/snip#10 --- gui-lib/info.rkt | 2 +- gui-test/tests/gracket/editor.rktl | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gui-lib/info.rkt b/gui-lib/info.rkt index 9e4535f1a..36d58d9c8 100644 --- a/gui-lib/info.rkt +++ b/gui-lib/info.rkt @@ -8,7 +8,7 @@ ["base" #:version "8.3.0.3"] ["syntax-color-lib" #:version "1.5"] ["draw-lib" #:version "1.18"] - ["snip-lib" #:version "1.5"] + ["snip-lib" #:version "1.6"] "wxme-lib" "pict-lib" "scheme-lib" diff --git a/gui-test/tests/gracket/editor.rktl b/gui-test/tests/gracket/editor.rktl index 9a2926372..2846502cc 100644 --- a/gui-test/tests/gracket/editor.rktl +++ b/gui-test/tests/gracket/editor.rktl @@ -728,6 +728,27 @@ (unless (<= 0 count2 (/ N 2)) (error 'notifications "not weak enough? ~e" count2))) +(let () + (define t (new text%)) + (define sl (new style-list%)) + (send t set-style-list sl) + (define cb-called? #f) + (define (cb s) + (set! cb-called? #t) + (send sl begin-style-change-sequence) + (send sl end-style-change-sequence)) + (define notification-key (send sl notify-on-change cb)) + (define b (send sl find-named-style "Basic")) + (define b2 (send sl new-named-style "Basic2" b)) + (send b2 set-delta (make-object style-delta% 'change-bigger 1)) + (define notification-key2 (send sl notify-on-change cb)) + (send sl begin-style-change-sequence) + (send b2 set-delta (make-object style-delta% 'change-bigger 1)) + (send sl end-style-change-sequence) + (set! cb-called? #f) + (send b2 set-delta (make-object style-delta% 'change-bigger 1)) + (test #t 'style-change-sequence-during-callback-works cb-called?)) + ;; ---------------------------------------- ;; make sure splitting a large string snip works: