source: branches/nanovis2/lang/tcl/tests/isa.test @ 3305

Last change on this file since 3305 was 3305, checked in by ldelgass, 12 years ago

sync with trunk

File size: 1.6 KB
Line 
1# Commands covered: Rappture::library
2#
3# This file contains a collection of tests for one of the Rappture Tcl
4# commands.  Sourcing this file into Tcl runs the tests and
5# generates output for errors.  No output means no errors were found.
6#
7# ======================================================================
8# AUTHOR:  Derrick Kearney, Purdue University
9# Copyright (c) 2004-2012  HUBzero Foundation, LLC
10#
11# See the file "license.terms" for information on usage and redistribution
12# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13
14
15if {[lsearch [namespace children] ::tcltest] == -1} {
16    package require tcltest
17    package require Rappture
18    namespace import -force ::tcltest::*
19}
20catch {unset lib}
21set lib [Rappture::library rplib_test.xml]
22
23itcl::class foo { # used for tests below }
24
25#----------------------------------------------------------
26# isa command
27# isa "<XMLObjType>"
28#----------------------------------------------------------
29test library-7.0.1 {isa command 0 arg} {
30    list [catch {$lib isa} msg] $msg
31} {1 {wrong # args: should be "object isa className"}}
32test library-7.1.1 {isa command 1 valid arg} {
33    $lib isa ::Rappture::LibraryObj
34} {1}
35test library-7.1.2 {isa command 1 invalid arg} {
36    $lib isa ::foo
37} {0}
38test library-7.1.3 {isa command 1 invalid arg} {
39    list [catch {$lib isa sdfsdf} result] $result
40} {1 {class "sdfsdf" not found in context "::Rappture::LibraryObj"}}
41test library-7.2.1 {isa command 2 args} {
42    list [catch {$lib isa ::Rappture::LibraryObj ::Rappture::LibraryObj} msg] $msg
43} {1 {wrong # args: should be "object isa className"}}
44
45
46::tcltest::cleanupTests
47return
Note: See TracBrowser for help on using the repository browser.