summaryrefslogtreecommitdiffstats
path: root/tests/source.test
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2022-08-31 15:24:20 (GMT)
committerkjnash <k.j.nash@usa.net>2022-08-31 15:24:20 (GMT)
commit7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8 (patch)
treea7402019faf3e75458552fe9dde90324f981fe7b /tests/source.test
parent19f8c3bb6b2aa8d571a7534b588ddacfb49952d3 (diff)
parent52b58d0c7d1575d7c784ccb344862e0de8a9686b (diff)
downloadtcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.zip
tcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.tar.gz
tcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.tar.bz2
Merge old 8.7 6c69a72c58
Diffstat (limited to 'tests/source.test')
-rw-r--r--tests/source.test24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/source.test b/tests/source.test
index 47f1486..eee03ec 100644
--- a/tests/source.test
+++ b/tests/source.test
@@ -111,7 +111,7 @@ test source-2.7 {utf-8 with BOM} -setup {
} -body {
set out [open $sourcefile w]
fconfigure $out -encoding utf-8
- puts $out "\ufeffset y new-y"
+ puts $out "\uFEFFset y new-y"
close $out
set y old-y
source -encoding utf-8 $sourcefile
@@ -199,7 +199,7 @@ test source-4.1 {continuation line parsing} -setup {
test source-6.1 {source is binary ok} -setup {
# Note [makeFile] writes in the system encoding.
# [source] defaults to reading in the system encoding.
- set sourcefile [makeFile [list set x "a b\0c"] source.file]
+ set sourcefile [makeFile [list set x "a b\x00c"] source.file]
} -body {
set x {}
source $sourcefile
@@ -208,7 +208,7 @@ test source-6.1 {source is binary ok} -setup {
removeFile source.file
} -result 5
test source-6.2 {source skips everything after Ctrl-Z: Bug 2040} -setup {
- set sourcefile [makeFile "set x ab\32c" source.file]
+ set sourcefile [makeFile "set x ab\x1Ac" source.file]
} -body {
set x {}
source $sourcefile
@@ -222,7 +222,7 @@ test source-7.1 {source -encoding test} -setup {
file delete $sourcefile
set f [open $sourcefile w]
fconfigure $f -encoding utf-8
- puts $f "set symbol(square-root) \u221A; set x correct"
+ puts $f "set symbol(square-root) √; set x correct"
close $f
} -body {
set x unset
@@ -233,15 +233,15 @@ test source-7.1 {source -encoding test} -setup {
} -result correct
test source-7.2 {source -encoding test} -setup {
# This tests for bad interactions between [source -encoding]
- # and use of the Control-Z character (\u001A) as a cross-platform
+ # and use of the Control-Z character (\x1A) as a cross-platform
# EOF character by [source]. Here we write out and the [source] a
- # file that contains the byte \x1A, although not the character \u001A in
+ # file that contains the byte \x1A, although not the character \x1A in
# the indicated encoding.
set sourcefile [makeFile {} source.file]
file delete $sourcefile
set f [open $sourcefile w]
fconfigure $f -encoding utf-16
- puts $f "set symbol(square-root) \u221A; set x correct"
+ puts $f "set symbol(square-root) √; set x correct"
close $f
} -body {
set x unset
@@ -266,25 +266,25 @@ test source-7.5 {source -encoding: correct operation} -setup {
file delete $sourcefile
set f [open $sourcefile w]
fconfigure $f -encoding utf-8
- puts $f "proc \u20ac {} {return foo}"
+ puts $f "proc € {} {return foo}"
close $f
} -body {
source -encoding utf-8 $sourcefile
- \u20ac
+ €
} -cleanup {
removeFile source.file
- rename \u20ac {}
+ rename € {}
} -result foo
test source-7.6 {source -encoding: mismatch encoding error} -setup {
set sourcefile [makeFile {} source.file]
file delete $sourcefile
set f [open $sourcefile w]
fconfigure $f -encoding utf-8
- puts $f "proc \u20ac {} {return foo}"
+ puts $f "proc € {} {return foo}"
close $f
} -body {
source -encoding ascii $sourcefile
- \u20ac
+ €
} -cleanup {
removeFile source.file
} -returnCodes error -match glob -result {invalid command name*}