Subject: For embedding support, select modernizations from Patrick Fradin

From: dgp <[email-masked]>
Date: Thu, 31 Jan 2013 04:29:30 +0000

---
 tests/main.test | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/main.test b/tests/main.test
index cdd3b17..324b594 100644
--- a/tests/main.test
+++ b/tests/main.test
@@ -137,7 +137,7 @@ namespace eval ::tcl::test::main {
 	set script [makeFile {} script]
 	file delete $script
 	set f [open $script w]
-	fconfigure $f -encoding utf-8
+	chan configure $f -encoding utf-8
 	puts $f {puts [list $argv0 $argv $tcl_interactive]}
 	puts -nonewline $f {puts [string equal \u20ac }
 	puts $f "\u20ac]"
@@ -158,7 +158,7 @@ namespace eval ::tcl::test::main {
 	set script [makeFile {} script]
 	file delete $script
 	set f [open $script w]
-	fconfigure $f -encoding utf-8
+	chan configure $f -encoding utf-8
 	puts $f {puts [list $argv0 $argv $tcl_interactive]}
 	puts -nonewline $f {puts [string equal \u20ac }
 	puts $f "\u20ac]"
@@ -179,7 +179,7 @@ namespace eval ::tcl::test::main {
 	set script [makeFile {} script]
 	file delete $script
 	set f [open $script w]
-	fconfigure $f -encoding utf-8
+	chan configure $f -encoding utf-8
 	puts $f {puts [list $argv0 $argv $tcl_interactive]}
 	puts -nonewline $f {puts [string equal \u20ac }
 	puts $f "\u20ac]"
@@ -600,7 +600,7 @@ namespace eval ::tcl::test::main {
 	catch {set f [open "|[list [interpreter]]" w+]}
     } -body {
 	type $f {
-	    fconfigure stdin -blocking 0
+	    chan configure stdin -blocking 0
 	    puts SUCCESS
 	}
 	list [catch {gets $f} line] $line
@@ -614,19 +614,19 @@ namespace eval ::tcl::test::main {
 	exec
     } -setup {
 	catch {set f [open "|[list [interpreter]]" w+]}
-	catch {fconfigure $f -blocking 0}
+	catch {chan configure $f -blocking 0}
     } -body {
-	type $f "fconfigure stdin -eofchar \\032
+	type $f "chan configure stdin -eofchar \\032
 	    if 1 \{\n\032"
 	variable wait
-	fileevent $f readable \
+	chan event $f readable \
 		[list set [namespace which -variable wait] "child exit"]
 	set id [after 2000 [list set [namespace which -variable wait] timeout]]
 	vwait [namespace which -variable wait]
 	after cancel $id
 	set wait
     } -cleanup {
-	if {[string equal timeout $wait] && [testConstraint unix]} {
+	if {$wait eq "timeout" && [testConstraint unix]} {
 	    exec kill [pid $f]
 	}
 	close $f
@@ -639,17 +639,17 @@ namespace eval ::tcl::test::main {
     } -setup {
 	set cmd {makeFile "if 1 \{" script}
 	catch {set f [open "|[list [interpreter]] < [list [eval $cmd]]" r]}
-	catch {fconfigure $f -blocking 0}
+	catch {chan configure $f -blocking 0}
     } -body {
 	variable wait
-	fileevent $f readable \
+	chan event $f readable \
 		[list set [namespace which -variable wait] "child exit"]
 	set id [after 2000 [list set [namespace which -variable wait] timeout]]
 	vwait [namespace which -variable wait]
 	after cancel $id
 	set wait
     } -cleanup {
-	if {[string equal timeout $wait] && [testConstraint unix]} {
+	if {$wait eq "timeout" && [testConstraint unix]} {
 	    exec kill [pid $f]
 	}
 	close $f
@@ -756,7 +756,7 @@ namespace eval ::tcl::test::main {
 	exec Tcltest
     } -setup {
 	catch {set f [open "|[list [interpreter]]" w+]}
-	catch {fconfigure $f -blocking 0}
+	catch {chan configure $f -blocking 0}
     } -body {
 	type $f "testsetmainloop
 	         after 2000 testexitmainloop
@@ -991,7 +991,7 @@ namespace eval ::tcl::test::main {
     } -body {
 	exec [interpreter] << {
 		testsetmainloop
-		fconfigure stdin -blocking 0
+		chan configure stdin -blocking 0
 		testexitmainloop
 	} >& result
 	set f [open result]
-- 
cgit v0.12