blob: 228bd63ca34eccff80f4f1e921362c9e0fa1a201 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# This file is a Tcl script to test out Tk's "bell" command.
#
# Copyright © 1994 The Regents of the University of California.
# Copyright © 1998-2000 Scriptics Corporation.
# All rights reserved.
#
# TESTFILE INITIALIZATION
#
package require tcltest 2.2; # needed in mode -singleproc 0
# Load the main script main.tcl, which takes care of:
# - setup for the application and the root window
# - importing commands from the tcltest namespace
# - loading of the testutils mechanism along with its utility procs
# - loading of Tk specific test constraints (additionally to constraints
# provided by the package tcltest)
source [file join [tcltest::configure -testdir] main.tcl]
# Ensure a pristine initial window state
resetWindows
#
# TESTS
#
test bell-1.1 {bell command} -body {
bell a
} -returnCodes error -result {bad option "a": must be -displayof or -nice}
test bell-1.2 {bell command} -body {
bell a b
} -returnCodes error -result {bad option "a": must be -displayof or -nice}
test bell-1.3 {bell command} -body {
bell -displayof gorp
} -returnCodes error -result {bad window path name "gorp"}
test bell-1.4 {bell command} -body {
bell -nice -displayof
} -returnCodes error -result {wrong # args: should be "bell ?-displayof window? ?-nice?"}
test bell-1.5 {bell command} -body {
bell -nice -nice -nice
} -returnCodes {ok} -result {} ;#keep -result {} and -returnCodes {ok} for clarity?
test bell-1.6 {bell command} -body {
bell -displayof . -nice
} -returnCodes {ok} -result {}
test bell-1.7 {bell command} -body {
bell -nice -displayof . -nice
} -returnCodes error -result {wrong # args: should be "bell ?-displayof window? ?-nice?"}
test bell-1.8 {bell command} -body {
puts "Bell should ring now ..."
flush stdout
after 200
bell -displayof .
after 200
bell -nice
after 200
bell
} -result {}
#
# TESTFILE CLEANUP
#
cleanupTests
|