os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/pid.test
Update contrib.
1 # Commands covered: pid
3 # This file contains a collection of tests for one or more of the Tcl
4 # built-in commands. Sourcing this file into Tcl runs the tests and
5 # generates output for errors. No output means no errors were found.
7 # Copyright (c) 1991-1993 The Regents of the University of California.
8 # Copyright (c) 1994-1995 Sun Microsystems, Inc.
9 # Copyright (c) 1998-1999 by Scriptics Corporation.
11 # See the file "license.terms" for information on usage and redistribution
12 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14 # RCS: @(#) $Id: pid.test,v 1.8.2.2 2004/02/25 23:38:17 dgp Exp $
16 if {[lsearch [namespace children] ::tcltest] == -1} {
17 package require tcltest 2
18 namespace import -force ::tcltest::*
21 # If pid is not defined just return with no error
22 # Some platforms may not have the pid command implemented
23 if {[info commands pid] == ""} {
24 puts "pid is not implemented for this machine"
25 ::tcltest::cleanupTests
29 test pid-1.1 {pid command} {
30 regexp {(^[0-9]+$)|(^0x[0-9a-fA-F]+$)} [pid]
32 test pid-1.2 {pid command} -constraints {unixOrPc unixExecs} -setup {
33 set path(test1) [makeFile {} test1]
34 file delete $path(test1)
36 set f [open |[list echo foo | cat >$path(test1)] w]
39 list [llength $pids] [regexp {^[0-9]+$} [lindex $pids 0]] \
40 [regexp {^[0-9]+$} [lindex $pids 1]] \
41 [expr {[lindex $pids 0] == [lindex $pids 1]}]
45 test pid-1.3 {pid command} -setup {
46 set path(test1) [makeFile {} test1]
47 file delete $path(test1)
49 set f [open $path(test1) w]
56 test pid-1.4 {pid command} {
57 list [catch {pid a b} msg] $msg
58 } {1 {wrong # args: should be "pid ?channelId?"}}
59 test pid-1.5 {pid command} {
60 list [catch {pid gorp} msg] $msg
61 } {1 {can not find channel named "gorp"}}
64 ::tcltest::cleanupTests