# Commands covered: Rappture::Library::xml # # 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} #---------------------------------------------------------- #---------------------------------------------------------- # xml command # xml #---------------------------------------------------------- test xml-1.1 {xml command, 0 args} { catch {unset lib} set lib [Rappture::library rplib_test.xml] set xmltext [$lib xml] } { Graphing Calculator Press Simulate to view results. @tool/graph @driver Example: 2*x + 1 30x5 dsd234ssdf3sdf some text 5x5 tluafed tnerruc 0 1 2 3 } test xml-2.1 {xml command, 1 argument} { catch {unset lib} set lib [Rappture::library rplib_test.xml] list [catch {$lib xml "1moreArg"} msg] $msg } {1 {wrong # args: should be "libraryObj1 xml"}} ::tcltest::cleanupTests return