1 | # Commands covered: none |
---|
2 | # |
---|
3 | # This file contains a collection of tests for Tcl_CallWhenDeleted. |
---|
4 | # Sourcing this file into Tcl runs the tests and generates output for |
---|
5 | # errors. No output means no errors were found. |
---|
6 | # |
---|
7 | # Copyright (c) 1993 The Regents of the University of California. |
---|
8 | # Copyright (c) 1994 Sun Microsystems, Inc. |
---|
9 | # Copyright (c) 1998-1999 by Scriptics Corporation. |
---|
10 | # |
---|
11 | # See the file "license.terms" for information on usage and redistribution |
---|
12 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
13 | # |
---|
14 | # RCS: @(#) $Id: dcall.test,v 1.6 2004/05/19 10:54:20 dkf Exp $ |
---|
15 | |
---|
16 | if {[lsearch [namespace children] ::tcltest] == -1} { |
---|
17 | package require tcltest |
---|
18 | namespace import -force ::tcltest::* |
---|
19 | } |
---|
20 | |
---|
21 | testConstraint testdcall [llength [info commands testdcall]] |
---|
22 | |
---|
23 | test dcall-1.1 {deletion callbacks} testdcall { |
---|
24 | lsort -increasing [testdcall 1 2 3] |
---|
25 | } {1 2 3} |
---|
26 | test dcall-1.2 {deletion callbacks} testdcall { |
---|
27 | testdcall |
---|
28 | } {} |
---|
29 | test dcall-1.3 {deletion callbacks} testdcall { |
---|
30 | lsort -increasing [testdcall 20 21 22 -22] |
---|
31 | } {20 21} |
---|
32 | test dcall-1.4 {deletion callbacks} testdcall { |
---|
33 | lsort -increasing [testdcall 20 21 22 -20] |
---|
34 | } {21 22} |
---|
35 | test dcall-1.5 {deletion callbacks} testdcall { |
---|
36 | lsort -increasing [testdcall 20 21 22 -21] |
---|
37 | } {20 22} |
---|
38 | test dcall-1.6 {deletion callbacks} testdcall { |
---|
39 | lsort -increasing [testdcall 20 21 22 -21 -22 -20] |
---|
40 | } {} |
---|
41 | |
---|
42 | # cleanup |
---|
43 | ::tcltest::cleanupTests |
---|
44 | return |
---|