archie/tk4.2/tests/winClipboard.test
2024-05-27 16:40:40 +02:00

41 lines
1.4 KiB
Plaintext

# This file is a Tcl script to test out Tk's Windows specific
# clipboard code. It is organized in the standard fashion for Tcl
# tests.
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands. Sourcing this file into Tcl runs the tests and
# generates output for errors. No output means no errors were found.
#
# Copyright (c) 1996 by Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# SCCS: @(#) winClipboard.test 1.2 96/10/04 17:48:11
if {[string compare test [info procs test]] == 1} {
source defs
}
test winClipboard-1.1 {TkSelGetSelection} {
clipboard clear
catch {selection get -selection CLIPBOARD} msg
set msg
} {CLIPBOARD selection doesn't exist or form "STRING" not defined}
test winClipboard-1.2 {TkSelGetSelection} {pcOnly} {
clipboard clear
clipboard append {}
list [selection get -selection CLIPBOARD] [testclipboard]
} {{} {}}
test winClipboard-1.3 {TkSelGetSelection & TkWinClipboardRender} {pcOnly} {
clipboard clear
clipboard append abcd
list [selection get -selection CLIPBOARD] [testclipboard]
} {abcd abcd}
test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} {pcOnly} {
clipboard clear
clipboard append "line 1\nline 2"
list [selection get -selection CLIPBOARD] [testclipboard]
} [list "line 1\nline 2" "line 1\r\nline 2"]