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 © 1993 The Regents of the University of California.
8# Copyright © 1994 Sun Microsystems, Inc.
9# Copyright © 1998-1999 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
14if {"::tcltest" ni [namespace children]} {
15    package require tcltest 2.5
16    namespace import -force ::tcltest::*
17}
18
19::tcltest::loadTestedCommands
20catch [list package require -exact tcl::test [info patchlevel]]
21
22testConstraint testdcall [llength [info commands testdcall]]
23
24test dcall-1.1 {deletion callbacks} testdcall {
25    lsort -increasing [testdcall 1 2 3]
26} {1 2 3}
27test dcall-1.2 {deletion callbacks} testdcall {
28    testdcall
29} {}
30test dcall-1.3 {deletion callbacks} testdcall {
31    lsort -increasing [testdcall 20 21 22 -22]
32} {20 21}
33test dcall-1.4 {deletion callbacks} testdcall {
34    lsort -increasing [testdcall 20 21 22 -20]
35} {21 22}
36test dcall-1.5 {deletion callbacks} testdcall {
37    lsort -increasing [testdcall 20 21 22 -21]
38} {20 22}
39test dcall-1.6 {deletion callbacks} testdcall {
40    lsort -increasing [testdcall 20 21 22 -21 -22 -20]
41} {}
42
43# cleanup
44cleanupTests
45return
46