aboutsummaryrefslogtreecommitdiff
path: root/tests/event.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2023-06-17 10:44:05 +1000
committerSteve Bennett <steveb@workware.net.au>2023-07-04 09:23:43 +1000
commitd6ce55ad7e01a51acb8a2a909383366ecc89d0b2 (patch)
tree6b4428d25bf8ecca748d9d411e7bb472d9eae05c /tests/event.test
parent41f431f30cc6118ef982c6374914810cd07a8106 (diff)
downloadjimtcl-d6ce55ad7e01a51acb8a2a909383366ecc89d0b2.zip
jimtcl-d6ce55ad7e01a51acb8a2a909383366ecc89d0b2.tar.gz
jimtcl-d6ce55ad7e01a51acb8a2a909383366ecc89d0b2.tar.bz2
tcltest: rework constraint system
Now 'constraint cmd|package' is like 'needs' but sets a constraint The command to 'needs cmd' and 'constraint cmd' can now take a subcommand to check. Add 'constraint|needs eval|expr' to make some constraint checks simpler. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/event.test')
-rw-r--r--tests/event.test20
1 files changed, 4 insertions, 16 deletions
diff --git a/tests/event.test b/tests/event.test
index b95f76e..453b713 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -12,22 +12,10 @@
source [file dirname [info script]]/testing.tcl
needs cmd after eventloop
-testConstraint socket [expr {[info commands socket] ne ""}]
-testConstraint exec [expr {[info commands exec] ne ""}]
-testConstraint signal [expr {[info commands signal] ne ""}]
-catch {[socket -ipv6 stream ::1:5000]} res
-set ipv6 1
-if {[string match "*not supported" $res]} {
- set ipv6 0
-} else {
- # Also, if we can't bind an IPv6 socket, don't run IPv6 tests
- if {[catch {
- [socket -ipv6 stream.server ::1:5000] close
- } msg opts]} {
- set ipv6 0
- }
-}
-testConstraint ipv6 $ipv6
+constraint cmd socket
+constraint cmd exec
+constraint cmd signal
+constraint eval ipv6 {[socket -ipv6 stream.server ::1:5000] close}
test event-5.1 {Tcl_BackgroundError, HandleBgErrors procedures} jim {
catch {rename bgerror {}}