File: ref.test

package info (click to toggle)
openocd 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 39,748 kB
  • sloc: ansic: 425,602; sh: 10,320; tcl: 9,539; asm: 3,895; makefile: 2,023; cpp: 1,671; perl: 1,197; python: 1,078; xml: 77; haskell: 32
file content (24 lines) | stat: -rw-r--r-- 505 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
source [file dirname [info script]]/testing.tcl

needs constraint jim
needs cmd ref
needs cmd collect

test collect-1.1 {ensure globally scoped references are deleted} {
	collect
	set result {}

	# Create a globally scoped reference as a function name
	set a ::[ref testfunction -]
	proc $a {} { return 3 }
	lappend result [$a]
	# It shouldn't be collected
	lappend result [collect]
	lappend result [$a]
	unset a
	# Now it should be collected
	lappend result [collect]
	set result
} {3 0 3 1}

testreport