Skip to content

Commit

Permalink
add a test case for the fix in racket/snip#10
Browse files Browse the repository at this point in the history
  • Loading branch information
rfindler committed Jan 28, 2024
1 parent eb0b53f commit b1aa614
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gui-lib/info.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions gui-test/tests/gracket/editor.rktl
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit b1aa614

Please sign in to comment.