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-2006 Purdue Research Foundation |
---|
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 | |
---|
15 | if {[lsearch [namespace children] ::tcltest] == -1} { |
---|
16 | package require tcltest |
---|
17 | package require Rappture |
---|
18 | namespace import -force ::tcltest::* |
---|
19 | } |
---|
20 | catch {unset lib} |
---|
21 | |
---|
22 | #---------------------------------------------------------- |
---|
23 | # isa command |
---|
24 | # isa "<XMLObjType>" |
---|
25 | #---------------------------------------------------------- |
---|
26 | test library-7.0.1 {isa command 0 arg} { |
---|
27 | catch {unset lib} |
---|
28 | set lib [Rappture::library rplib_test.xml] |
---|
29 | list [catch {$lib isa} msg] $msg |
---|
30 | } {1 {wrong # args: should be "::libraryObj0 isa <objType>"}} |
---|
31 | test library-7.1.1 {isa command 1 valid arg} { |
---|
32 | catch {unset lib} |
---|
33 | set lib [Rappture::library rplib_test.xml] |
---|
34 | $lib isa ::Rappture::LibraryObj |
---|
35 | } {1} |
---|
36 | test library-7.1.2 {isa command 1 invalid arg} { |
---|
37 | catch {unset lib} |
---|
38 | set lib [Rappture::library rplib_test.xml] |
---|
39 | $lib isa ::Rappture::Curve |
---|
40 | } {0} |
---|
41 | test library-7.1.3 {isa command 1 invalid arg} { |
---|
42 | catch {unset lib} |
---|
43 | set lib [Rappture::library rplib_test.xml] |
---|
44 | $lib isa sdfsdf |
---|
45 | } {0} |
---|
46 | test library-7.2.1 {isa command 2 args} { |
---|
47 | catch {unset lib} |
---|
48 | set lib [Rappture::library rplib_test.xml] |
---|
49 | list [catch {$lib isa ::Rappture::LibraryObj ::Rappture::LibraryObj} msg] $msg |
---|
50 | } {1 {wrong # args: should be "::libraryObj4 isa <objType>"}} |
---|
51 | |
---|
52 | |
---|
53 | ::tcltest::cleanupTests |
---|
54 | return |
---|