Tk Library Source Code

Artifact [7dc8ebae51]
Login

Artifact 7dc8ebae51a0bf5e570015d46630d7b9c765c6d4:

Attachment "testcursor.test" to ticket [2082457fff] added by relaxmike 2008-09-11 21:06:33.
#
# cursorctext.test --
#   Unit tests for the cursor package over a ctext mega-widget.
#
#   Copyright: Michael Baudin, 2008, [email protected]
#
package require tcltest
tcltest::configure -verbose {body pass skip start error}
package require ctext
package require cursor 

tcltest::test cursorctext-1 {basic usage} {
    set mytext [ctext .mytext]
    set result {}
    lappend result [.mytext cget -cursor]
    ::cursor::propagate . watch
    lappend result [.mytext cget -cursor]
    ::cursor::restore .
    lappend result [.mytext cget -cursor]
    destroy $mytext
    set result $result
    # Result is : xterm watch watch
} {xterm watch xterm}
tcltest::test cursorctext-2 {basic usage} {
    set mytext [ctext .mytext]
    set result {}
    lappend result [.mytext cget -cursor]
    ::cursor::propagate . watch
    lappend result [.mytext cget -cursor]
    ::cursor::restore . -depthfirst 1
    lappend result [.mytext cget -cursor]
    destroy $mytext
    set result $result
    # Result is : xterm watch watch
} {xterm watch xterm}
::tcltest::cleanupTests