# This file is a Tcl script to test out Tk's "bell" command.
# It is organized in the standard fashion for Tcl tests.
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id: bell.test,v 1.4 1999/04/16 01:51:33 stanton Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
}

test bell-1.1 {bell command} {
    list [catch {bell a} msg] $msg
} {1 {wrong # args: should be "bell ?-displayof window?"}}
test bell-1.2 {bell command} {
    list [catch {bell a b} msg] $msg
} {1 {bad option "a": must be -displayof}}
test bell-1.3 {bell command} {
    list [catch {bell -displayof gorp} msg] $msg
} {1 {bad window path name "gorp"}}
test bell-1.4 {bell command} {
    puts "Bell should ring now ..."
    flush stdout
    after 500
    bell -displayof .
    after 200
    bell
    after 200
    bell
} {}

# cleanup
::tcltest::cleanupTests
return