racket/collects/mrlib/private/aligned-pasteboard/tests/test-locked-pasteboard.rkt
Eli Barzilay b8034828d0 Sort the mess with aligned-pasteboard tests.
1. Lots of #lang-ization, other racketizations, code improvements, etc.

2. Some files that were not working now do.

3. "collects/tests/aligned-pasteboard" had some files that were near
   duplicates of "collects/mrlib/private/aligned-pasteboard/tests".
   I've removed the former since in a few places it looked like an older
   version (eg, there were bogus references to a non-existent
   "utils.rkt").  The former has more files that are in runnable
   condition now.

4. There are plenty of tests that look like they're failing, but it
   wasn't shown since they just return #f, and when they were running
   with a "-f" these results weren't displayed.

5. I have no idea about the code, this is all just reshuffling and minor
   editing.
2012-06-19 01:42:20 -04:00

22 lines
703 B
Racket

#lang racket/gui
(require "../locked-pasteboard.rkt" mrlib/click-forwarding-editor)
(define f (new frame% [width 400] [height 500] [label "test"]))
(define e (new (click-forwarding-editor-mixin
(locked-pasteboard-mixin pasteboard%))))
(define c (new editor-canvas% [parent f] [editor e]))
(define t (new text%))
(define s (new editor-snip% [editor t]))
(send e insert s 0 100)
(define t2 (new text%))
(define s2 (new editor-snip% [editor t2]))
(send e insert s2 100 0)
(send f show #t)
;; This test is not automated. To test it try to use the pasteboard that
;; appears.
;; (test:mouse-click 'left 0 100)
;; (test:keystroke #\A)
;; (string=? (send s get-text) "A")
;; (send f show #f)