# Commands covered: Rappture::library # # This file contains a collection of tests for one of the Rappture Tcl # commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # ====================================================================== # AUTHOR: Derrick Kearney, Purdue University # Copyright (c) 2004-2012 HUBzero Foundation, LLC # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest package require Rappture namespace import -force ::tcltest::* } catch {unset lib} set lib [Rappture::library rplib_test.xml] itcl::class foo { # used for tests below } #---------------------------------------------------------- # isa command # isa "" #---------------------------------------------------------- test library-7.0.1 {isa command 0 arg} { list [catch {$lib isa} msg] $msg } {1 {wrong # args: should be "object isa className"}} test library-7.1.1 {isa command 1 valid arg} { $lib isa ::Rappture::LibraryObj } {1} test library-7.1.2 {isa command 1 invalid arg} { $lib isa ::foo } {0} test library-7.1.3 {isa command 1 invalid arg} { list [catch {$lib isa sdfsdf} result] $result } {1 {class "sdfsdf" not found in context "::Rappture::LibraryObj"}} test library-7.2.1 {isa command 2 args} { list [catch {$lib isa ::Rappture::LibraryObj ::Rappture::LibraryObj} msg] $msg } {1 {wrong # args: should be "object isa className"}} ::tcltest::cleanupTests return