Debian Codegraph @

tests/dcall.test

raw
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 if {"::tcltest" ni [namespace children]} {
15 package require tcltest 2.5
16 namespace import -force ::tcltest::*
17 }
18
19 ::tcltest::loadTestedCommands
20 catch [list package require -exact Tcltest [info patchlevel]]
21
22 testConstraint testdcall [llength [info commands testdcall]]
23
24 test dcall-1.1 {deletion callbacks} testdcall {
25 lsort -increasing [testdcall 1 2 3]
26 } {1 2 3}
27 test dcall-1.2 {deletion callbacks} testdcall {
28 testdcall
29 } {}
30 test dcall-1.3 {deletion callbacks} testdcall {
31 lsort -increasing [testdcall 20 21 22 -22]
32 } {20 21}
33 test dcall-1.4 {deletion callbacks} testdcall {
34 lsort -increasing [testdcall 20 21 22 -20]
35 } {21 22}
36 test dcall-1.5 {deletion callbacks} testdcall {
37 lsort -increasing [testdcall 20 21 22 -21]
38 } {20 22}
39 test dcall-1.6 {deletion callbacks} testdcall {
40 lsort -increasing [testdcall 20 21 22 -21 -22 -20]
41 } {}
42
43 # cleanup
44 cleanupTests
45 return