summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2002-09-02 19:16:23 (GMT)
committerhobbs <hobbs@noemail.net>2002-09-02 19:16:23 (GMT)
commit5581a0cec2e389609041338307de1019197e234d (patch)
tree57a4ac634f6f7502add4d42adfdda01e1f07236f /tests
parent9263b34683b1363796dfaf920f417e5371f8bde6 (diff)
downloadtk-5581a0cec2e389609041338307de1019197e234d.zip
tk-5581a0cec2e389609041338307de1019197e234d.tar.gz
tk-5581a0cec2e389609041338307de1019197e234d.tar.bz2
* generic/tkCmds.c:
* generic/tkWindow.c: made 'tk' available in safe interpreters, but only the caret and windowingsystem subcommands may be called. * tests/safe.test (safe-1.2): noted that tk is now available in safe interps, but not the appname/scaling subcommands. FossilOrigin-Name: bb0ef89dd63bf132f0d68fdedf719b34dce04363
Diffstat (limited to 'tests')
-rw-r--r--tests/safe.test30
1 files changed, 26 insertions, 4 deletions
diff --git a/tests/safe.test b/tests/safe.test
index ba483dc..060a1e1 100644
--- a/tests/safe.test
+++ b/tests/safe.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: safe.test,v 1.9 2002/07/13 20:28:35 dgp Exp $
+# RCS: @(#) $Id: safe.test,v 1.10 2002/09/02 19:16:24 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -38,11 +38,11 @@ tcltest::loadTestedCommands
# The set of hidden commands is platform dependent:
if {"$tcl_platform(platform)" == "macintosh"} {
- set hidden_cmds {beep bell cd clipboard echo encoding exit fconfigure file glob grab load ls menu open pwd selection send socket source tk tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile toplevel wm}
+ set hidden_cmds {beep bell cd clipboard echo encoding exit fconfigure file glob grab load ls menu open pwd selection send socket source tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile toplevel wm}
} elseif {"$tcl_platform(platform)" == "windows"} {
- set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection socket source tk tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile tk_messageBox toplevel wm}
+ set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection socket source tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile tk_messageBox toplevel wm}
} else {
- set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection send socket source tk toplevel wm}
+ set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection send socket source toplevel wm}
}
test safe-1.1 {Safe Tk loading into an interpreter} {
@@ -91,6 +91,28 @@ test safe-2.2 {Unsafe commands not available} {
safe::interpDelete a
set status
} ok
+test safe-2.3 {Unsafe subcommands not available} {
+ catch {safe::interpDelete a}
+ safe::interpCreate a
+ safe::loadTk a
+ set status broken
+ if {[catch {interp eval a {tk appname}} msg]} {
+ set status ok
+ }
+ safe::interpDelete a
+ list $status $msg
+} {ok {appname not accessible in a safe interpreter}}
+test safe-2.4 {Unsafe subcommands not available} {
+ catch {safe::interpDelete a}
+ safe::interpCreate a
+ safe::loadTk a
+ set status broken
+ if {[catch {interp eval a {tk scaling}} msg]} {
+ set status ok
+ }
+ safe::interpDelete a
+ list $status $msg
+} {ok {scaling not accessible in a safe interpreter}}
test safe-3.1 {Unsafe commands are available hidden} {
catch {safe::interpDelete a}