source: trunk/base/src/registry2.0/tests/item.tcl @ 27518

Last change on this file since 27518 was 27518, checked in by sfiera@…, 10 years ago

Committing registry2.0 to local branch

File size: 1.3 KB
Line 
1# Test file for registry::item
2# Syntax:
3# tclsh item.tcl <Pextlib name>
4
5proc main {pextlibname} {
6    load $pextlibname
7
8    set aesc [registry::item create]
9    set wynn [registry::item create]
10    set eth [registry::item create]
11    set thorn [registry::item create]
12
13    test {[registry::item exists $aesc]}
14    test {![registry::item exists kumquat]}
15    test {![registry::item exists string]}
16
17    $aesc key name aesc
18    $wynn key name wynn
19    $eth key name eth
20    $thorn key name thorn
21
22    test_equal {[$aesc key name]} "aesc"
23    test_equal {[$thorn key name]} "thorn"
24
25    $aesc key variants {}
26    $wynn key variants {}
27    $eth key variants {{big +} {small -}}
28    $thorn key variants {{big +} {small -}}
29
30        test_equal {[registry::item search {name aesc}]} "$aesc"
31    test_equal {[registry::item search {variants {}}]} "$aesc $wynn"
32    test_equal {[registry::item search {variants {{big +}}}]} ""
33    test_equal {[registry::item search {variants {{big +} {small -}}}]} "$eth $thorn"
34        test_equal {[registry::item search {name wynn} {variants {}}]} "$wynn"
35
36        $aesc release
37        $wynn retain
38        $wynn release
39
40        test {![registry::item exists $aesc]}
41        test {[registry::item exists $wynn]}
42
43        $wynn release
44
45        test {![registry::item exists $wynn]}
46
47        file delete -force test.db
48}
49
50source tests/common.tcl
51main $argv
Note: See TracBrowser for help on using the repository browser.