source: trunk/src/tcl/tests/isa.test @ 403

Last change on this file since 403 was 403, checked in by dkearney, 19 years ago

lots of good additions/fixes for tcl bindings,
initial test suite uploading, test suite still needs works.
units tests closely follow code and show some differences between
previous tcl units conversions and core's units conversions.
all other tests need works still.

File size: 1.8 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-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
15if {[lsearch [namespace children] ::tcltest] == -1} {
16    package require tcltest
17    package require Rappture
18    namespace import -force ::tcltest::*
19}
20catch {unset lib}
21
22#----------------------------------------------------------
23# isa command
24# isa "<XMLObjType>"
25#----------------------------------------------------------
26test 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>"}}
31test 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}
36test 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}
41test 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}
46test 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
54return
Note: See TracBrowser for help on using the repository browser.