summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-11-14 10:25:33 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-11-14 10:25:33 (GMT)
commit2f86234cbc7748ccb2028dffe113d2acfad28c28 (patch)
tree5a4e684400f8ce16e1a1b639e9133e5f293a6a25 /tests
parent37fbc7330c9e687eac6bc39a0bce202bb4bf83d5 (diff)
parentdffcad90e2d661e520f735c824ddff5f1d630ddd (diff)
downloadtcl-2f86234cbc7748ccb2028dffe113d2acfad28c28.zip
tcl-2f86234cbc7748ccb2028dffe113d2acfad28c28.tar.gz
tcl-2f86234cbc7748ccb2028dffe113d2acfad28c28.tar.bz2
merge trunk
Diffstat (limited to 'tests')
-rw-r--r--tests/socket.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/socket.test b/tests/socket.test
index 5542c09..51219e6 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -1841,6 +1841,7 @@ test socket-14.4 {[socket -async] and both, readdable and writable fileevents} \
after cancel $after
close $client
close $server
+ unset x
} -result {{} bye}
test socket-14.5 {[socket -async] which fails before any connect() can be made} \
-constraints [list socket supported_any] \
@@ -1850,6 +1851,33 @@ test socket-14.5 {[socket -async] which fails before any connect() can be made}
} \
-returnCodes 1 \
-result {couldn't open socket: cannot assign requested address}
+test socket-14.6 {[socket -async] with no event loop and [fconfigure -error] before the socket is connected} \
+ -constraints [list socket supported_inet supported_inet6] \
+ -setup {
+ proc accept {s a p} {
+ puts $s bye
+ close $s
+ }
+ set server [socket -server accept -myaddr 127.0.0.1 0]
+ set port [lindex [fconfigure $server -sockname] 2]
+ set x ""
+ } \
+ -body {
+ set client [socket -async localhost $port]
+ foreach _ {1 2} {
+ lappend x [lindex [fconfigure $client -sockname] 0]
+ lappend x [fconfigure $client -error]
+ update
+ }
+ lappend x [gets $client]
+ } \
+ -cleanup {
+ close $server
+ close $client
+ unset x
+ } \
+ -result [list ::1 "connection refused" 127.0.0.1 "" bye]
+
::tcltest::cleanupTests
flush stdout
return