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

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tk/] [tests/] [util.test] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# This file is a Tcl script to test out the procedures in the file
2
# tkUtil.c.  It is organized in the standard fashion for Tcl tests.
3
#
4
# Copyright (c) 1994 The Regents of the University of California.
5
# Copyright (c) 1994 Sun Microsystems, Inc.
6
#
7
# See the file "license.terms" for information on usage and redistribution
8
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
9
#
10
# RCS: @(#) $Id: util.test,v 1.1.1.1 2002-01-16 10:26:00 markom Exp $
11
 
12
if {[string compare test [info procs test]] == 1} then \
13
  {source defs}
14
 
15
foreach i [winfo children .] {
16
    destroy $i
17
}
18
wm geometry . {}
19
raise .
20
 
21
listbox .l -width 20 -height 5 -relief sunken -bd 2
22
pack .l
23
.l insert 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
24
update
25
test util-1.1 {Tk_GetScrollInfo procedure} {
26
    list [catch {.l yview moveto a b} msg] $msg
27
} {1 {wrong # args: should be ".l yview moveto fraction"}}
28
test util-1.2 {Tk_GetScrollInfo procedure} {
29
    list [catch {.l yview moveto xyz} msg] $msg
30
} {1 {expected floating-point number but got "xyz"}}
31
test util-1.3 {Tk_GetScrollInfo procedure} {
32
    .l yview 0
33
    .l yview moveto .5
34
    .l yview
35
} {0.5 0.75}
36
test util-1.4 {Tk_GetScrollInfo procedure} {
37
    list [catch {.l yview scroll a} msg] $msg
38
} {1 {wrong # args: should be ".l yview scroll number units|pages"}}
39
test util-1.5 {Tk_GetScrollInfo procedure} {
40
    list [catch {.l yview scroll a b c} msg] $msg
41
} {1 {wrong # args: should be ".l yview scroll number units|pages"}}
42
test util-1.6 {Tk_GetScrollInfo procedure} {
43
    list [catch {.l yview scroll xyz units} msg] $msg
44
} {1 {expected integer but got "xyz"}}
45
test util-1.7 {Tk_GetScrollInfo procedure} {
46
    .l yview 0
47
    .l yview scroll 2 pages
48
    .l nearest 0
49
} {6}
50
test util-1.8 {Tk_GetScrollInfo procedure} {
51
    .l yview 15
52
    .l yview scroll -2 pages
53
    .l nearest 0
54
} {9}
55
test util-1.9 {Tk_GetScrollInfo procedure} {
56
    .l yview 0
57
    .l yview scroll 2 units
58
    .l nearest 0
59
} {2}
60
test util-1.10 {Tk_GetScrollInfo procedure} {
61
    .l yview 15
62
    .l yview scroll -2 units
63
    .l nearest 0
64
} {13}
65
test util-1.11 {Tk_GetScrollInfo procedure} {
66
    list [catch {.l yview scroll 3 zips} msg] $msg
67
} {1 {bad argument "zips": must be units or pages}}
68
test util-1.12 {Tk_GetScrollInfo procedure} {
69
    list [catch {.l yview dropdead 3 times} msg] $msg
70
} {1 {unknown option "dropdead": must be moveto or scroll}}

powered by: WebSVN 2.1.0

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