author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
# security.test -- |
sl@0 | 2 |
# |
sl@0 | 3 |
# Functionality covered: this file contains a collection of tests for the |
sl@0 | 4 |
# auto loading and namespaces. |
sl@0 | 5 |
# |
sl@0 | 6 |
# Sourcing this file into Tcl runs the tests and generates output for |
sl@0 | 7 |
# errors. No output means no errors were found. |
sl@0 | 8 |
# |
sl@0 | 9 |
# Copyright (c) 1997 Sun Microsystems, Inc. |
sl@0 | 10 |
# Copyright (c) 1998-1999 by Scriptics Corporation. |
sl@0 | 11 |
# All rights reserved. |
sl@0 | 12 |
# |
sl@0 | 13 |
# RCS: @(#) $Id: security.test,v 1.5 2000/04/10 17:19:04 ericm Exp $ |
sl@0 | 14 |
|
sl@0 | 15 |
if {[lsearch [namespace children] ::tcltest] == -1} { |
sl@0 | 16 |
package require tcltest |
sl@0 | 17 |
namespace import -force ::tcltest::* |
sl@0 | 18 |
} |
sl@0 | 19 |
|
sl@0 | 20 |
# If this proc becomes invoked, then there is a bug |
sl@0 | 21 |
|
sl@0 | 22 |
proc BUG {args} { |
sl@0 | 23 |
set ::BUG 1 |
sl@0 | 24 |
} |
sl@0 | 25 |
|
sl@0 | 26 |
# Check and Clear the bug flag (to do before each test) |
sl@0 | 27 |
set ::BUG 0 |
sl@0 | 28 |
|
sl@0 | 29 |
proc CB {} { |
sl@0 | 30 |
set ret $::BUG |
sl@0 | 31 |
set ::BUG 0 |
sl@0 | 32 |
return $ret |
sl@0 | 33 |
} |
sl@0 | 34 |
|
sl@0 | 35 |
|
sl@0 | 36 |
test sec-1.1 {tcl_endOfPreviousWord} { |
sl@0 | 37 |
catch {tcl_startOfPreviousWord x {[BUG]}} |
sl@0 | 38 |
CB |
sl@0 | 39 |
} 0 |
sl@0 | 40 |
|
sl@0 | 41 |
# cleanup |
sl@0 | 42 |
::tcltest::cleanupTests |
sl@0 | 43 |
return |
sl@0 | 44 |
|
sl@0 | 45 |
|
sl@0 | 46 |
|
sl@0 | 47 |
|
sl@0 | 48 |
|
sl@0 | 49 |
|
sl@0 | 50 |
|
sl@0 | 51 |
|
sl@0 | 52 |
|
sl@0 | 53 |
|
sl@0 | 54 |