OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tix/] [tests/] [hlist/] [DirList.tcl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# This file tests the pixmap image reader
2
#
3
 
4
proc About {} {
5
    return "This file performs test on the DirList widget"
6
}
7
 
8
proc Test {} {
9
    set w .dirlist
10
 
11
    tixDirList $w
12
    pack $w
13
 
14
    set h [$w subwidget hlist]
15
 
16
    # If we didn't specifi -value, the DirList should display the
17
    # current directory
18
    Assert {[tixStrEq [$w cget -value] [tixFSPWD]]}
19
 
20
    # After changing the directory, the selection and anchor should change as
21
    # well
22
    set root [$h info children ""]
23
    ClickHListEntry $h $root single
24
    Assert {[tixStrEq [$w cget -value] [$h info data $root]]}
25
    Assert {[tixStrEq [$h info selection] $root]}
26
    Assert {[tixStrEq [$h info anchor]    $root]}
27
 
28
    case [tix platform] {
29
        unix {
30
            set dir1 /etc
31
            set dir2 /etc
32
        }
33
        windows {
34
            set dir1 C:\\Windows
35
            set dir2 C:\\Backup
36
        }
37
        default {
38
            return
39
        }
40
    }
41
 
42
    foreach dir [list $dir1 $dir2] {
43
        if ![file exists $dir] {
44
            continue
45
        }
46
 
47
        $w config -value $dir
48
        Assert {[tixStrEq [$w cget -value] $dir]}
49
        Assert {[tixStrEq [$h info data [$h info anchor]] $dir]}
50
    }
51
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.