summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2020-07-09 17:56:33 (GMT)
committerkjnash <k.j.nash@usa.net>2020-07-09 17:56:33 (GMT)
commita6ad8c5f1b59fd374e129d9643732581744475b8 (patch)
tree12d677adeba42fd6e439cbe939b963aaafc130c6
parent4ca3e59e50cd57a6c696d5bb9810787733a0415d (diff)
downloadtcl-a6ad8c5f1b59fd374e129d9643732581744475b8.zip
tcl-a6ad8c5f1b59fd374e129d9643732581744475b8.tar.gz
tcl-a6ad8c5f1b59fd374e129d9643732581744475b8.tar.bz2
Rename command ::safe::SetAutoPathSync to ::safe::setAutoPathSync and add to library/tclIndex.
-rw-r--r--library/safe.tcl14
-rw-r--r--library/tclIndex1
-rw-r--r--tests/safe.test82
3 files changed, 49 insertions, 48 deletions
diff --git a/library/safe.tcl b/library/safe.tcl
index 54f9cc9..84db786 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -326,7 +326,7 @@ proc ::safe::InterpCreate {
#
# It is the caller's responsibility, if it supplies a non-empty value for
# access_path, to make the first directory in the path suitable for use as
-# tcl_library, and (if ![SetAutoPathSync]), to set the slave's ::auto_path.
+# tcl_library, and (if ![setAutoPathSync]), to set the slave's ::auto_path.
proc ::safe::InterpSetConfig {slave access_path staticsok nestedok deletehook autoPath withAutoPath} {
global auto_path
@@ -404,9 +404,9 @@ if {[info exists state(access_path,map)]} {
# Set the slave auto_path to a tokenized raw_auto_path.
# Silently ignore any directories that are not in the access path.
- # If [SetAutoPathSync], SyncAccessPath will overwrite this value with the
+ # If [setAutoPathSync], SyncAccessPath will overwrite this value with the
# full access path.
- # If ![SetAutoPathSync], Safe Base code will not change this value.
+ # If ![setAutoPathSync], Safe Base code will not change this value.
set tokens_auto_path {}
foreach dir $raw_auto_path {
if {[dict exists $remap_access_path $dir]} {
@@ -1237,8 +1237,8 @@ proc ::safe::Setup {} {
return
}
-# Accessor method for ::safe::SetAutoPathSync
-# Usage: ::safe::SetAutoPathSync ?newValue?
+# Accessor method for ::safe::AutoPathSync
+# Usage: ::safe::setAutoPathSync ?newValue?
# Respond to changes by calling Setup again, precerving any
# caller-defined logging. This allows complete equivalence with
# prior Safe Base behavior if AutoPathSync is true.
@@ -1251,7 +1251,7 @@ proc ::safe::Setup {} {
# (The initialization of AutoPathSync at the end of this file is acceptable
# because Setup has not yet been called.)
-proc ::safe::SetAutoPathSync {args} {
+proc ::safe::setAutoPathSync {args} {
variable AutoPathSync
if {[llength $args] == 0} {
@@ -1274,7 +1274,7 @@ proc ::safe::SetAutoPathSync {args} {
setLogCmd $TmpLog
}
} else {
- set msg {wrong # args: should be "safe::SetAutoPathSync ?newValue?"}
+ set msg {wrong # args: should be "safe::setAutoPathSync ?newValue?"}
return -code error $msg
}
diff --git a/library/tclIndex b/library/tclIndex
index 87a2814..6bb3fa6 100644
--- a/library/tclIndex
+++ b/library/tclIndex
@@ -61,6 +61,7 @@ set auto_index(::safe::DirInAccessPath) [list ::tcl::Pkg::source [file join $dir
set auto_index(::safe::Subset) [list ::tcl::Pkg::source [file join $dir safe.tcl]]
set auto_index(::safe::AliasSubset) [list ::tcl::Pkg::source [file join $dir safe.tcl]]
set auto_index(::safe::AliasEncoding) [list ::tcl::Pkg::source [file join $dir safe.tcl]]
+set auto_index(::safe::setAutoPathSync) [list source [file join $dir safe.tcl]]
set auto_index(tcl_wordBreakAfter) [list ::tcl::Pkg::source [file join $dir word.tcl]]
set auto_index(tcl_wordBreakBefore) [list ::tcl::Pkg::source [file join $dir word.tcl]]
set auto_index(tcl_endOfWord) [list ::tcl::Pkg::source [file join $dir word.tcl]]
diff --git a/tests/safe.test b/tests/safe.test
index 8fb0983..4fd3eef 100644
--- a/tests/safe.test
+++ b/tests/safe.test
@@ -184,11 +184,11 @@ test safe-6.3 {test safe interpreters knowledge of the world} {
# high level general test
test safe-7.1 {tests that everything works at high level with conventional AutoPathSync} -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 1
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 1
}
set i [safe::interpCreate]
@@ -204,16 +204,16 @@ test safe-7.1 {tests that everything works at high level with conventional AutoP
} -cleanup {
safe::interpDelete $i
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -match glob -result 2.*
test safe-7.2 {tests specific path and interpFind/AddToAccessPath with conventional AutoPathSync} -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 1
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 1
} else {
set SyncVal_TMP 1
}
@@ -231,7 +231,7 @@ test safe-7.2 {tests specific path and interpFind/AddToAccessPath with conventio
[safe::interpDelete $i]
} -cleanup {
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -match glob -result "{\$p(:0:)} {\$p(:*:)} 1 {can't find package http 1} {-accessPath {[list $tcl_library */dummy/unixlike/test/path]} -statics 0 -nested 1 -deleteHook {}} {}"
test safe-7.3 {check that safe subinterpreters work} {
@@ -242,11 +242,11 @@ test safe-7.3 {check that safe subinterpreters work} {
test safe-7.4 {tests specific path and positive search with conventional AutoPathSync} -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 1
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 1
} else {
set SyncVal_TMP 1
}
@@ -265,17 +265,17 @@ test safe-7.4 {tests specific path and positive search with conventional AutoPat
# other than the first and last in the access path.
} -cleanup {
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -match glob -result "{\$p(:0:)} {\$p(:*:)} 0 1.0 {-accessPath {[list $tcl_library *$tcl_library/http1.0]} -statics 0 -nested 1 -deleteHook {}} {}"
test safe-7.5 {tests positive and negative module loading with conventional AutoPathSync} -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 1
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 1
}
set i [safe::interpCreate]
@@ -294,7 +294,7 @@ test safe-7.5 {tests positive and negative module loading with conventional Auto
} -cleanup {
safe::interpDelete $i
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -result {1 {can't find package shell} 0}
@@ -962,13 +962,13 @@ test safe-17.2 {Check that first element of slave auto_path (and access path) is
test safe-18.1 {cf. safe-7.1 - tests that everything works at high level without conventional AutoPathSync} -constraints AutoSyncDefined -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 0
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 0
} else {
- error {This test is meaningful only if the command ::safe::SetAutoPathSync is defined}
+ error {This test is meaningful only if the command ::safe::setAutoPathSync is defined}
}
# Without AutoPathSync, we need a more complete auto_path, because the slave will use the same value.
@@ -990,19 +990,19 @@ test safe-18.1 {cf. safe-7.1 - tests that everything works at high level without
set ::auto_path $::auto_TMP
safe::interpDelete $i
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -result 1.0
test safe-18.2 {cf. safe-7.2 - tests specific path and interpFind/AddToAccessPath without conventional AutoPathSync} -constraints AutoSyncDefined -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 0
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 0
} else {
- error {This test is meaningful only if the command ::safe::SetAutoPathSync is defined}
+ error {This test is meaningful only if the command ::safe::setAutoPathSync is defined}
}
} -body {
set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]]
@@ -1020,19 +1020,19 @@ test safe-18.2 {cf. safe-7.2 - tests specific path and interpFind/AddToAccessPat
[safe::interpDelete $i]
} -cleanup {
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -match glob -result "{} {\$p(:0:)} {\$p(:*:)} 1 {can't find package http 1} {-accessPath {[list $tcl_library */dummy/unixlike/test/path]} -statics 0 -nested 1 -deleteHook {}} {}"
test safe-18.3 {Check that default auto_path is the same as in the master interpreter without conventional AutoPathSync} -constraints AutoSyncDefined -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 0
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 0
} else {
- error {This test is meaningful only if the command ::safe::SetAutoPathSync is defined}
+ error {This test is meaningful only if the command ::safe::setAutoPathSync is defined}
}
set i [safe::interpCreate]
@@ -1049,19 +1049,19 @@ test safe-18.3 {Check that default auto_path is the same as in the master interp
} -cleanup {
safe::interpDelete $i
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -result [set ::auto_path]
test safe-18.4 {cf. safe-7.4 - tests specific path and positive search and auto_path without conventional AutoPathSync} -constraints AutoSyncDefined -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 0
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 0
} else {
- error {This test is meaningful only if the command ::safe::SetAutoPathSync is defined}
+ error {This test is meaningful only if the command ::safe::setAutoPathSync is defined}
}
} -body {
set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]]
@@ -1087,19 +1087,19 @@ test safe-18.4 {cf. safe-7.4 - tests specific path and positive search and auto_
[safe::interpDelete $i]
} -cleanup {
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -match glob -result "{} {{\$p(:0:)}} {\$p(:0:)} {\$p(:*:)} 0 1.0 {-accessPath {[list $tcl_library *$tcl_library/http1.0]} -statics 0 -nested 1 -deleteHook {}} {}"
test safe-18.5 {cf. safe-7.5 - tests positive and negative module loading without conventional AutoPathSync} -setup {
# All ::safe commands are loaded at start of file.
- set SyncExists [expr {[info commands ::safe::SetAutoPathSync] ne {}}]
+ set SyncExists [expr {[info commands ::safe::setAutoPathSync] ne {}}]
if {$SyncExists} {
- set SyncVal_TMP [safe::SetAutoPathSync]
- safe::SetAutoPathSync 0
+ set SyncVal_TMP [safe::setAutoPathSync]
+ safe::setAutoPathSync 0
} else {
- error {This test is meaningful only if the command ::safe::SetAutoPathSync is defined}
+ error {This test is meaningful only if the command ::safe::setAutoPathSync is defined}
}
set i [safe::interpCreate]
@@ -1118,7 +1118,7 @@ test safe-18.5 {cf. safe-7.5 - tests positive and negative module loading withou
} -cleanup {
safe::interpDelete $i
if {$SyncExists} {
- safe::SetAutoPathSync $SyncVal_TMP
+ safe::setAutoPathSync $SyncVal_TMP
}
} -result {1 {can't find package shell} 0}