diff options
author | welch <welch> | 1998-06-27 18:06:37 (GMT) |
---|---|---|
committer | welch <welch> | 1998-06-27 18:06:37 (GMT) |
commit | adcb060b5ab8d310f5aff8a1119d3b97baf86641 (patch) | |
tree | 759f8786c82028afeb67bd971309b7b328d81d7f /tests/safe.test | |
parent | d010dca55fd7a02e3fe6e50910359d8d4915f003 (diff) | |
download | tk-adcb060b5ab8d310f5aff8a1119d3b97baf86641.zip tk-adcb060b5ab8d310f5aff8a1119d3b97baf86641.tar.gz tk-adcb060b5ab8d310f5aff8a1119d3b97baf86641.tar.bz2 |
plugin updates
Diffstat (limited to 'tests/safe.test')
-rw-r--r-- | tests/safe.test | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/safe.test b/tests/safe.test index 65aed36..3eaf504 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -119,4 +119,51 @@ test safe-4.2 {testing loadTk -use} { destroy $w } {} +test safe-5.1 {loading Tk in safe interps without master's clearance} { + set i [safe::interpCreate] + catch {interp eval $i {load {} Tk}} msg + safe::interpDelete $i + set msg +} {not allowed to start Tk by master's safe::TkInit} + +test safe-5.2 {multi-level Tk loading with clearance} { + # No error shall occur in that test and no window + # shall remain at the end. + set i [safe::interpCreate] + set j [list $i x] + set j [safe::interpCreate $j] + safe::loadTk $j + interp eval $j { + button .b -text Ok -command {destroy .} + pack .b +# tkwait window . ; # for interactive testing/debugging + } + safe::interpDelete $j + safe::interpDelete $i +} {} + +test safe-6.1 {loadTk -use windowPath} { + set w .safeTkFrame + catch {destroy $w} + frame $w -container 1; + pack .safeTkFrame + set i [safe::loadTk [safe::interpCreate] -use $w] + interp eval $i {button .b -text "hello world!"; pack .b} + safe::interpDelete $i + destroy $w +} {} + +test safe-6.2 {loadTk -use windowPath, conflicting -display} { + set w .safeTkFrame + catch {destroy $w} + frame $w -container 1; + pack .safeTkFrame + set i [safe::interpCreate] + catch {safe::loadTk $i -use $w -display :23.56} msg + safe::interpDelete $i + destroy $w + string range $msg 0 36 +} {conflicting -display :23.56 and -use } + + unset hidden_cmds |