# Commands covered: # Rappture::Units::convert # Rappture::Units::description # Rappture::Units::System::for # Rappture::Units::System::all # Rappture::Units::Search::for # # 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} proc check {var size} { set l [llength $var] if {$l != $size} { return "length mismatch: should have been $size, was $l" } for {set i 0} {$i < $size} {set i [expr $i+1]} { set j [lindex $var $i] if {$j != "item $i"} { return "element $i should have been \"item $i\", was \"$j\"" } } return ok } #---------------------------------------------------------- #---------------------------------------------------------- # convert command # Rappture::Units::convert ?-context? ?-to units? ?-units on/off? #---------------------------------------------------------- test convert-1.0.1 {Rappture::Units::convert, 0 arguments} { list [catch {Rappture::Units::convert} msg] $msg } {1 {wrong # args: should be "Rappture::Units::convert ?-context units? ?-to units? ?-units on/off?"}} test convert-1.1.1 {Rappture::Units::convert, 1 invalid argument} { list [catch {Rappture::Units::convert re} msg] $msg } {1 {bad value "re": should be a real number with units}} test convert-1.1.2 {Rappture::Units::convert, invalid value, valid context} { list [catch {Rappture::Units::convert re -context mm} msg] $msg } {1 {bad value "re": should be a real number with units of (A,bohr,in,m)}} test convert-1.1.3 {Rappture::Units::convert, 1 valid argument} { list [catch {Rappture::Units::convert 5} msg] $msg } {1 {value: "5" has unrecognized units}} test convert-1.2.0 {Rappture::Units::convert, 1 valid argument w/ units} { list [catch {Rappture::Units::convert 5m} msg] $msg } {0 5m} test convert-1.3.0 {Rappture::Units::convert, -context blank} { list [catch {Rappture::Units::convert 5m -context} msg] $msg } {0 5m} test convert-1.3.1 {Rappture::Units::convert, -context valid} { list [catch {Rappture::Units::convert 5m -context m} msg] $msg } {0 5m} #test convert-1.3.2.1 {Rappture::Units::convert, -context invalid} { ## this test passes for old tcl version, fails for new tcl bindings # list [catch {Rappture::Units::convert 5m -context ff} msg] $msg #} {0 5m} test convert-1.3.2.2 {Rappture::Units::convert, -context invalid} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::convert 5m -context xx} msg] $msg } {1 {bad value "xx": should be a recognized unit for Rappture}} test convert-1.4.0 {Rappture::Units::convert, -to blank} { list [catch {Rappture::Units::convert 5m -to} msg] $msg } {0 5m} #test convert-1.4.1.1 {Rappture::Units::convert, -to valid} { ## this test passes for old tcl version, fails for new tcl bindings # list [catch {Rappture::Units::convert 5m -to A} msg] $msg #} {0 50000000000A} test convert-1.4.1.2 {Rappture::Units::convert, -to valid} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::convert 5m -to A} msg] $msg } {0 5e+10A} #test convert-1.4.2.1 {Rappture::Units::convert, -to invalid} { ## this test passes for old tcl version, fails for new tcl bindings # list [catch {Rappture::Units::convert 5m -to ff} msg] $msg #} {1 {invalid command name ""}} test convert-1.4.2.2 {Rappture::Units::convert, -to invalid} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::convert 5m -to xx} msg] $msg } {1 {bad value "xx": should be a recognized unit for Rappture}} #test convert-1.5.0 {Rappture::Units::convert, -units blank} { ## this test passes for old tcl version, fails for new tcl bindings # list [catch {Rappture::Units::convert 5m -units} msg] $msg #} {1 {expected boolean value but got ""}} test convert-1.5.0 {Rappture::Units::convert, -units blank} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::convert 5m -units} msg] $msg } {1 {expected boolean value but got ""}} test convert-1.5.1 {Rappture::Units::convert, -units on} { list [catch {Rappture::Units::convert 5m -units on} msg] $msg } {0 5m} #test convert-1.5.2.1 {Rappture::Units::convert, -units off} { ## this test passes for old tcl version, fails for new tcl bindings ## comments for the Rappture::Units::convert function specify that ## If the -to system is not specified, then the value is converted to ## fundamental units for the current system. but the code just returns ## the value, as specified by lines 115-118 or units.tcl 20060414 # list [catch {Rappture::Units::convert 5m -units off} msg] $msg #} {0 5m} test convert-1.5.2.2 {Rappture::Units::convert, -units off} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::convert 5m -units off} msg] $msg } {0 5} test convert-1.5.3 {Rappture::Units::convert, -units invalid} { # this test passes for new tcl bindings, fails for old tcl version # because tcl version makes -units depend of -to flag being populated. list [catch {Rappture::Units::convert 5m -units sdfsd} msg] $msg } {1 {expected boolean value but got "sdfsd"}} #test convert-1.6.0.1 {Rappture::Units::convert, all flags, all valid} { ## this test passes for old tcl version, fails for new tcl bindings ## new bindings return scientific notation. # list [catch {Rappture::Units::convert 5m -context m -to A -units off} msg] $msg #} {0 50000000000} test convert-1.6.0.2 {Rappture::Units::convert, all flags, all valid} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::convert 5m -context m -to A -units off} msg] $msg } {0 5e+10} test convert-1.7.0 {Rappture::Units::convert, val w/o units} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::convert 5 -context m} msg] $msg } {0 5m} #test convert-1.7.1.1 {Rappture::Units::convert, invalid val w/ -context} { ## this test passes for old tcl version, fails for new tcl bindings # list [catch {Rappture::Units::convert de -context m } msg] $msg #} {1 {bad value "de": should be a real number with units of (m,A)}} test convert-1.7.1.2 {Rappture::Units::convert, invalid val w/ -context} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::convert de -context m } msg] $msg } {1 {bad value "de": should be a real number with units of (A,bohr,in,m)}} test convert-1.8.0 {Rappture::Units::convert, convert undefined unit} { list [catch {Rappture::Units::convert 33Q -to nm } msg] $msg } {1 {Unrecognized units: "Q". Should be units of type length (A,bohr,in,m)}} #---------------------------------------------------------- #---------------------------------------------------------- # description command # Rappture::Units::description #---------------------------------------------------------- test desc-2.0.0 {Rappture::Units::descption, blank units} { list [catch {Rappture::Units::description} msg] $msg } {1 {wrong # args: should be "Rappture::Units::description units"}} test desc-2.1.0 {Rappture::Units::descption, invalid units} { # special note in the tcl bindings code reflects that i think # this behavior is incorrect, but tcl bindings comply with the # tcl version for now. list [catch {Rappture::Units::description qqq} msg] $msg } {0 {}} test desc-2.2.0 {Rappture::Units::descption, valid units} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::description eV} msg] $msg } {0 {energy (J,eV)}} test desc-2.2.1 {Rappture::Units::descption, *cm2*K/Vs} { list [catch {Rappture::Units::description *cm2*K/Vs} msg] $msg } {0 {length*temperature/electric_potential*time (/V,/s,A2,C,F,K,R,bohr2,in2,m2)}} test desc-2.2.2 {Rappture::Units::descption, cm2 areas} { list [catch {Rappture::Units::description cm2} msg] $msg } {0 {area (A2,bohr2,in2,m2)}} test desc-2.2.3 {Rappture::Units::descption, cm3 volumes} { list [catch {Rappture::Units::description cm3} msg] $msg } {0 {volume (A3,bohr3,in3,m3)}} test desc-2.2.4 {Rappture::Units::descption, K temperature} { list [catch {Rappture::Units::description K} msg] $msg } {0 {temperature (C,F,K,R)}} test desc-2.2.5 {Rappture::Units::descption, s time} { list [catch {Rappture::Units::description s} msg] $msg } {0 {time (s)}} test desc-2.3.0 {Rappture::Units::descption, too many args} { list [catch {Rappture::Units::description eV ee} msg] $msg } {1 {wrong # args: should be "Rappture::Units::description units"}} test desc-2.3.1 {Rappture::Units::descption, incorrect input type} { list [catch {Rappture::Units::description 3cm} msg] $msg } {0 {}} test desc-2.4.0 {Rappture::Units::descption, "mm" correct units retrieval} { list [catch {Rappture::Units::description mm} msg] $msg } {0 {length (A,bohr,in,m)}} test desc-2.4.1 {Rappture::Units::descption, "MM" correct units retrieval} { list [catch {Rappture::Units::description MM} msg] $msg } {0 {length (A,bohr,in,m)}} test desc-2.4.2 {Rappture::Units::descption, "mM" correct units retrieval} { list [catch {Rappture::Units::description mM} msg] $msg } {0 {length (A,bohr,in,m)}} test desc-2.4.3 {Rappture::Units::descption, "Mm" correct units retrieval} { list [catch {Rappture::Units::description Mm} msg] $msg } {0 {length (A,bohr,in,m)}} test desc-2.4.4 {Rappture::Units::descption, "mv" correct units retrieval} { list [catch {Rappture::Units::description mv} msg] $msg } {0 {electric_potential (V)}} test desc-2.4.5 {Rappture::Units::descption, "mV" correct units retrieval} { list [catch {Rappture::Units::description mV} msg] $msg } {0 {electric_potential (V)}} test desc-2.4.6 {Rappture::Units::descption, "MV" correct units retrieval} { list [catch {Rappture::Units::description MV} msg] $msg } {0 {electric_potential (V)}} test desc-2.4.7 {Rappture::Units::descption, "Mv" correct units retrieval} { list [catch {Rappture::Units::description Mv} msg] $msg } {0 {electric_potential (V)}} test desc-2.4.8 {Rappture::Units::descption, "ms" correct units retrieval} { list [catch {Rappture::Units::description ms} msg] $msg } {0 {time (s)}} test desc-2.4.9 {Rappture::Units::descption, "mS" correct units retrieval} { list [catch {Rappture::Units::description mS} msg] $msg } {0 {time (s)}} test desc-2.4.10 {Rappture::Units::descption, "MS" correct units retrieval} { list [catch {Rappture::Units::description MS} msg] $msg } {0 {time (s)}} test desc-2.4.11 {Rappture::Units::descption, "Ms" correct units retrieval} { list [catch {Rappture::Units::description Ms} msg] $msg } {0 {time (s)}} #---------------------------------------------------------- #---------------------------------------------------------- # for command # Rappture::Units::System::for #---------------------------------------------------------- #test for-3.0.0.1 {Rappture::Units::System::for, blank units} { ## this test passes for old tcl version, fails for new tcl bindings ## because of additional "::" prefixed on object name # list [catch {Rappture::Units::System::for} msg] $msg #} {1 {wrong # args: should be "::Rappture::Units::System::for units"}} test for-3.0.0.2 {Rappture::Units::System::for, blank units} { list [catch {Rappture::Units::System::for} msg] $msg } {1 {wrong # args: should be "Rappture::Units::System::for units"}} test for-3.1.0 {Rappture::Units::System::for, invalid units} { # special note in the tcl bindings code reflects that i think # this behavior is incorrect, but tcl bindings comply with the # tcl version for now. list [catch {Rappture::Units::System::for qqq} msg] $msg } {0 {}} #test for-3.2.0.1 {Rappture::Units::System::for, valid units} { ## this test passes for old tcl version, fails for new tcl bindings ## because different order of units # list [catch {Rappture::Units::System::for eV} msg] $msg #} {0 ::Rappture::Units::system6} test for-3.2.0.2 {Rappture::Units::System::for, valid units} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::System::for eV} msg] $msg } {0 energy} #test for-3.3.0.1 {Rappture::Units::System::for, too many args} { ## this test passes for old tcl version, fails for new tcl bindings ## because of additional "::" prefixed on object name # list [catch {Rappture::Units::System::for eV ee} msg] $msg #} {1 {wrong # args: should be "::Rappture::Units::System::for units"}} test for-3.3.0.2 {Rappture::Units::System::for, too many args} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::System::for eV ee} msg] $msg } {1 {wrong # args: should be "Rappture::Units::System::for units"}} #---------------------------------------------------------- #---------------------------------------------------------- # all command # Rappture::Units::Sys::all #---------------------------------------------------------- #test all-4.0.0.1 {Rappture::Units::System::all, blank} { ## this test passes for old tcl version, fails for new tcl bindings ## because of additional "::" prefixed on object name # list [catch {Rappture::Units::System::all} msg] $msg #} {1 {wrong # args: should be "::Rappture::Units::System::all units"}} test all-4.0.0.2 {Rappture::Units::System::all, blank units} { list [catch {Rappture::Units::System::all} msg] $msg } {1 {wrong # args: should be "Rappture::Units::System::all units"}} test all-4.1.0 {Rappture::Units::System::all, invalid units} { # special note in the tcl bindings code reflects that i think # this behavior is incorrect, but tcl bindings comply with the # tcl version for now. list [catch {Rappture::Units::System::all qqq} msg] $msg } {0 {}} #test all-4.2.0.1 {Rappture::Units::System::all, valid units} { ## this test passes for old tcl version, fails for new tcl bindings ## because different order of units # list [catch {Rappture::Units::System::all eV} msg] $msg #} {0 {eV J}} test all-4.2.0.2 {Rappture::Units::System::all, valid units} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::System::all eV} msg] $msg } {0 {J eV}} #test all-4.3.0.1 {Rappture::Units::System::all, too many args} { ## this test passes for old tcl version, fails for new tcl bindings ## because of additional "::" prefixed on object name # list [catch {Rappture::Units::System::all eV ee} msg] $msg #} {1 {wrong # args: should be "::Rappture::Units::System::all units"}} test all-4.3.0.2 {Rappture::Units::System::all, too many args} { # this test passes for new tcl bindings, fails for old tcl version list [catch {Rappture::Units::System::all eV ee} msg] $msg } {1 {wrong # args: should be "Rappture::Units::System::all units"}} #---------------------------------------------------------- #---------------------------------------------------------- # convert command - testing units conversions #---------------------------------------------------------- test convert_units-5.4.1.0 {Rappture::Units::convert, m->A} { list [catch {Rappture::Units::convert 5m -to A} msg] $msg } {0 5e+10A} test convert_units-5.4.1.1 {Rappture::Units::convert, m<-A} { list [catch {Rappture::Units::convert 5A -to m} msg] $msg } {0 5e-10m} #-------------------------------------------------------------------- # Metric Extension Conversions #-------------------------------------------------------------------- test convert_units-5.4.2.0 {Rappture::Units::convert, m->dm} { list [catch {Rappture::Units::convert 5m -to dm} msg] $msg } {0 50dm} test convert_units-5.4.2.1 {Rappture::Units::convert, m->cm} { list [catch {Rappture::Units::convert 5m -to cm} msg] $msg } {0 500cm} test convert_units-5.4.2.3 {Rappture::Units::convert, m->mm} { list [catch {Rappture::Units::convert 5m -to mm} msg] $msg } {0 5000mm} test convert_units-5.4.2.4 {Rappture::Units::convert, m->um} { list [catch {Rappture::Units::convert 5m -to um} msg] $msg } {0 5e+06um} test convert_units-5.4.2.5 {Rappture::Units::convert, m->nm} { list [catch {Rappture::Units::convert 5m -to nm} msg] $msg } {0 5e+09nm} test convert_units-5.4.2.6 {Rappture::Units::convert, m->pm} { list [catch {Rappture::Units::convert 5m -to pm} msg] $msg } {0 5e+12pm} test convert_units-5.4.2.7 {Rappture::Units::convert, m->fm} { list [catch {Rappture::Units::convert 5m -to fm} msg] $msg } {0 5e+15fm} test convert_units-5.4.2.8 {Rappture::Units::convert, m->am} { list [catch {Rappture::Units::convert 5m -to am} msg] $msg } {0 5e+18am} test convert_units-5.4.2.9 {Rappture::Units::convert, m->dam} { list [catch {Rappture::Units::convert 5m -to dam} msg] $msg } {0 0.5dam} test convert_units-5.4.2.10 {Rappture::Units::convert, m->hm} { list [catch {Rappture::Units::convert 5m -to hm} msg] $msg } {0 0.05hm} test convert_units-5.4.2.11 {Rappture::Units::convert, m->km} { list [catch {Rappture::Units::convert 5m -to km} msg] $msg } {0 0.005km} test convert_units-5.4.2.12 {Rappture::Units::convert, m->Mm} { list [catch {Rappture::Units::convert 5m -to Mm} msg] $msg } {0 5e-06Mm} test convert_units-5.4.2.13 {Rappture::Units::convert, m->Gm} { list [catch {Rappture::Units::convert 5m -to Gm} msg] $msg } {0 5e-09Gm} test convert_units-5.4.2.14 {Rappture::Units::convert, m->Tm} { list [catch {Rappture::Units::convert 5m -to Tm} msg] $msg } {0 5e-12Tm} test convert_units-5.4.2.15 {Rappture::Units::convert, m->Pm} { list [catch {Rappture::Units::convert 5m -to Pm} msg] $msg } {0 5e-15Pm} test convert_units-5.4.2.16 {Rappture::Units::convert, m->Em} { list [catch {Rappture::Units::convert 5m -to Em} msg] $msg } {0 5e-18Em} test convert_units-5.4.2.17 {Rappture::Units::convert, dm->m} { list [catch {Rappture::Units::convert 5dm -to m} msg] $msg } {0 0.5m} test convert_units-5.4.2.18 {Rappture::Units::convert, cm->m} { list [catch {Rappture::Units::convert 5cm -to m} msg] $msg } {0 0.05m} test convert_units-5.4.2.19 {Rappture::Units::convert, mm->m} { list [catch {Rappture::Units::convert 5mm -to m} msg] $msg } {0 0.005m} test convert_units-5.4.2.20 {Rappture::Units::convert, um->m} { list [catch {Rappture::Units::convert 5um -to m} msg] $msg } {0 5e-06m} test convert_units-5.4.2.21 {Rappture::Units::convert, nm->m} { list [catch {Rappture::Units::convert 5nm -to m} msg] $msg } {0 5e-09m} test convert_units-5.4.2.22 {Rappture::Units::convert, pm->m} { list [catch {Rappture::Units::convert 5pm -to m} msg] $msg } {0 5e-12m} test convert_units-5.4.2.23 {Rappture::Units::convert, fm->m} { list [catch {Rappture::Units::convert 5fm -to m} msg] $msg } {0 5e-15m} test convert_units-5.4.2.24 {Rappture::Units::convert, am->m} { list [catch {Rappture::Units::convert 5am -to m} msg] $msg } {0 5e-18m} test convert_units-5.4.2.25 {Rappture::Units::convert, dam->m} { list [catch {Rappture::Units::convert 5dam -to m} msg] $msg } {0 50m} test convert_units-5.4.2.26 {Rappture::Units::convert, hm->m} { list [catch {Rappture::Units::convert 5hm -to m} msg] $msg } {0 500m} test convert_units-5.4.2.27 {Rappture::Units::convert, km->m} { list [catch {Rappture::Units::convert 5km -to m} msg] $msg } {0 5000m} test convert_units-5.4.2.28 {Rappture::Units::convert, Mm->m} { list [catch {Rappture::Units::convert 5Mm -to m} msg] $msg } {0 5e+06m} test convert_units-5.4.2.29 {Rappture::Units::convert, Gm->G} { list [catch {Rappture::Units::convert 5Gm -to m} msg] $msg } {0 5e+09m} test convert_units-5.4.2.30 {Rappture::Units::convert, Tm->m} { list [catch {Rappture::Units::convert 5Tm -to m} msg] $msg } {0 5e+12m} test convert_units-5.4.2.31 {Rappture::Units::convert, Pm->m} { list [catch {Rappture::Units::convert 5Pm -to m} msg] $msg } {0 5e+15m} test convert_units-5.4.2.32 {Rappture::Units::convert, Em->m} { list [catch {Rappture::Units::convert 5Em -to m} msg] $msg } {0 5e+18m} #-------------------------------------------------------------------- # Concentration Conversions #-------------------------------------------------------------------- test convert_units-5.4.3.0 {Rappture::Units::convert, pH->pOH} { list [catch {Rappture::Units::convert 5pH -to pOH} msg] $msg } {0 9pOH} test convert_units-5.4.3.1 {Rappture::Units::convert, pOH->pH} { list [catch {Rappture::Units::convert 9pOH -to pH} msg] $msg } {0 5pH} #-------------------------------------------------------------------- # Multiple Unit Conversions #-------------------------------------------------------------------- test convert_units-5.4.4.0 {Rappture::Units::convert, cm2/Vs->m2/kVus} { list [catch {Rappture::Units::convert 2cm2/Vs -to m2/kVus} msg] $msg } {0 2e-07m2/kVus} test convert_units-5.4.4.1 {Rappture::Units::convert, cm2/Vs->m2/kQus} { list [catch {Rappture::Units::convert 2cm2/Vs -to m2/kQus} msg] $msg } {1 {bad value "m2/kQus": should be a recognized unit for Rappture}} test convert_units-5.4.4.2 {Rappture::Units::convert, cm2nZ/Vs->m2/us} { list [catch {Rappture::Units::convert 2cm2nZ/Vs -to m2/us} msg] $msg } {1 {Unrecognized units: "cm2nZ/Vs". Should be units of type length/time (/s,A2,bohr2,in2,m2)}} test convert_units-5.4.4.3 {Rappture::Units::convert, cm2/s->m2/kVus} { list [catch {Rappture::Units::convert 2cm2/s -to m2/kVus} msg] $msg } {1 {unmatched units in conversion: (kV-1) Please enter units of type length/electric_potential*time (/V,/s,A2,bohr2,in2,m2)}} test convert_units-5.4.4.4 {Rappture::Units::convert, cm2/s->m2/uskV} { list [catch {Rappture::Units::convert 2cm2/s -to m2/uskV} msg] $msg } {1 {unmatched units in conversion: (kV-1) Please enter units of type length/time*electric_potential (/V,/s,A2,bohr2,in2,m2)}} test convert_units-5.4.4.5 {Rappture::Units::convert, cm2V/s->m2/us} { list [catch {Rappture::Units::convert 2cm2V/s -to m2/us} msg] $msg } {1 {unmatched units in conversion: (V) Please enter units of type length/time (/s,A2,bohr2,in2,m2)}} test convert_units-5.4.4.6 {Rappture::Units::convert, cm2V/s->m2/us} { list [catch {Rappture::Units::convert 2cm2V/s -to m2/us} msg] $msg } {1 {unmatched units in conversion: (V) Please enter units of type length/time (/s,A2,bohr2,in2,m2)}} test convert_units-5.4.4.7 {Rappture::Units::convert, cm2V->m2} { list [catch {Rappture::Units::convert 2cm2V -to m2} msg] $msg } {1 {unmatched units in conversion: (V) Please enter units of type length (A2,bohr2,in2,m2)}} test convert_units-5.4.4.8 {Rappture::Units::convert, Vcm2->m2} { list [catch {Rappture::Units::convert 2Vcm2 -to m2} msg] $msg } {1 {unmatched units in conversion: (V) Please enter units of type length (A2,bohr2,in2,m2)}} test convert_units-5.4.4.9 {Rappture::Units::convert, cm2->Vm2} { list [catch {Rappture::Units::convert 2cm2 -to Vm2} msg] $msg } {1 {unmatched units in conversion: (V) Please enter units of type electric_potential*length (A2,V,bohr2,in2,m2)}} test convert_units-5.4.4.10 {Rappture::Units::convert, cm2->m2V} { list [catch {Rappture::Units::convert 2cm2 -to m2V} msg] $msg } {1 {unmatched units in conversion: (V) Please enter units of type length*electric_potential (A2,V,bohr2,in2,m2)}} test convert_units-5.4.4.11 {Rappture::Units::convert, cm2A->Vm2} { list [catch {Rappture::Units::convert 2cm2A -to Vm2} msg] $msg } {1 {unmatched units in conversion: (A) -> (V) Please enter units of type electric_potential*length (A2,V,bohr2,in2,m2)}} test convert_units-5.4.4.12 {Rappture::Units::convert, cm2A->m2V} { list [catch {Rappture::Units::convert 2cm2A -to m2V} msg] $msg } {1 {Conversion unavailable: (A) -> (V) Please enter units of type length*electric_potential (A2,V,bohr2,in2,m2)}} test convert_units-5.4.4.13 {Rappture::Units::convert, Acm2->Vm2} { list [catch {Rappture::Units::convert 2Acm2 -to Vm2} msg] $msg } {1 {unmatched units in conversion: (A) -> (V) Please enter units of type electric_potential*length (A2,V,bohr2,in2,m2)}} test convert_units-5.4.4.14 {Rappture::Units::convert, Acm2->m2V} { list [catch {Rappture::Units::convert 2Acm2 -to m2V} msg] $msg } {1 {Conversion unavailable: (A) -> (V) Please enter units of type length*electric_potential (A2,V,bohr2,in2,m2)}} #-------------------------------------------------------------------- # Inverse Unit Conversions #-------------------------------------------------------------------- test convert_units-5.4.5.0 {Rappture::Units::convert, /cm2->/m2} { list [catch {Rappture::Units::convert 2/cm2 -to /m2} msg] $msg } {0 20000/m2} test convert_units-5.4.5.1 {Rappture::Units::convert, cm2->/m2} { list [catch {Rappture::Units::convert 1cm -to /m2} msg] $msg } {1 {Conversion unavailable: (cm) -> (m-2) Please enter units of type /area (/A2,/bohr2,/in2,/m2)}} #-------------------------------------------------------------------- # Temperature Conversions #-------------------------------------------------------------------- test convert_units-5.4.6.0 {Rappture::Units::convert, F->C} { list [catch {Rappture::Units::convert 78.8F -to C} msg] $msg } {0 26C} test convert_units-5.4.6.1 {Rappture::Units::convert, C->F} { list [catch {Rappture::Units::convert 26C -to F} msg] $msg } {0 78.8F} test convert_units-5.4.6.2 {Rappture::Units::convert, C->K} { list [catch {Rappture::Units::convert 26C -to K} msg] $msg } {0 299.15K} test convert_units-5.4.6.3 {Rappture::Units::convert, K->C} { list [catch {Rappture::Units::convert 299.15K -to C} msg] $msg } {0 26C} test convert_units-5.4.6.4 {Rappture::Units::convert, K->F} { list [catch {Rappture::Units::convert 299.15K -to F} msg] $msg } {0 78.8F} test convert_units-5.4.6.5 {Rappture::Units::convert, F->K} { list [catch {Rappture::Units::convert 78.8F -to K} msg] $msg } {0 299.15K} test convert_units-5.4.6.6 {Rappture::Units::convert, F->R} { list [catch {Rappture::Units::convert 78.8F -to R} msg] $msg } {0 538.47R} test convert_units-5.4.6.7 {Rappture::Units::convert, R->F} { list [catch {Rappture::Units::convert 538.47R -to F} msg] $msg } {0 78.8F} test convert_units-5.4.6.8 {Rappture::Units::convert, R->C} { list [catch {Rappture::Units::convert 538.47R -to C} msg] $msg } {0 26C} test convert_units-5.4.6.9 {Rappture::Units::convert, C->R} { list [catch {Rappture::Units::convert 26C -to R} msg] $msg } {0 538.47R} test convert_units-5.4.6.10 {Rappture::Units::convert, R->K} { list [catch {Rappture::Units::convert 538.47R -to K} msg] $msg } {0 299.15K} test convert_units-5.4.6.11 {Rappture::Units::convert, K->R} { list [catch {Rappture::Units::convert 299.15K -to R} msg] $msg } {0 538.47R} test convert_units-5.4.6.12 {Rappture::Units::convert, K->mK} { list [catch {Rappture::Units::convert 299.15K -to mK} msg] $msg } {0 299150mK} test convert_units-5.4.6.13 {Rappture::Units::convert, K->mk} { list [catch {Rappture::Units::convert 299.15K -to mk} msg] $msg } {0 299150mK} test convert_units-5.4.6.14 {Rappture::Units::convert, C->mC} { list [catch {Rappture::Units::convert 100C -to mC} msg] $msg } {0 100000mC} test convert_units-5.4.6.15 {Rappture::Units::convert, C->mc} { list [catch {Rappture::Units::convert 100C -to mc} msg] $msg } {0 100000mC} #-------------------------------------------------------------------- # Energy Conversions #-------------------------------------------------------------------- test convert_units-5.4.7.0 {Rappture::Units::convert, eV->J} { list [catch {Rappture::Units::convert 5eV -to J} msg] $msg } {0 8.01089e-19J} test convert_units-5.4.7.1 {Rappture::Units::convert, J->eV} { list [catch {Rappture::Units::convert 8.01088231e-19J -to eV} msg] $msg } {0 5eV} #-------------------------------------------------------------------- # Time Conversions #-------------------------------------------------------------------- test convert_units-5.4.8.0 {Rappture::Units::convert, s->s} { list [catch {Rappture::Units::convert 5s -to s} msg] $msg } {0 5s} test convert_units-5.4.8.1 {Rappture::Units::convert, min->s} { list [catch {Rappture::Units::convert 5min -to s} msg] $msg } {0 300s} test convert_units-5.4.8.2 {Rappture::Units::convert, h->s} { list [catch {Rappture::Units::convert 5h -to s} msg] $msg } {0 18000s} test convert_units-5.4.8.3 {Rappture::Units::convert, d->s} { list [catch {Rappture::Units::convert 5d -to s} msg] $msg } {0 432000s} test convert_units-5.4.8.4 {Rappture::Units::convert, s->min} { list [catch {Rappture::Units::convert 5s -to min} msg] $msg } {0 0.0833333min} test convert_units-5.4.8.5 {Rappture::Units::convert, min->min} { list [catch {Rappture::Units::convert 5min -to min} msg] $msg } {0 5min} test convert_units-5.4.8.6 {Rappture::Units::convert, h->min} { list [catch {Rappture::Units::convert 5h -to min} msg] $msg } {0 300min} test convert_units-5.4.8.7 {Rappture::Units::convert, d->min} { list [catch {Rappture::Units::convert 5d -to min} msg] $msg } {0 7200min} test convert_units-5.4.8.8 {Rappture::Units::convert, s->h} { list [catch {Rappture::Units::convert 5s -to h} msg] $msg } {0 0.00138889h} test convert_units-5.4.8.9 {Rappture::Units::convert, min->h} { list [catch {Rappture::Units::convert 5min -to h} msg] $msg } {0 0.0833333h} test convert_units-5.4.8.10 {Rappture::Units::convert, h->h} { list [catch {Rappture::Units::convert 5h -to h} msg] $msg } {0 5h} test convert_units-5.4.8.11 {Rappture::Units::convert, d->h} { list [catch {Rappture::Units::convert 5d -to h} msg] $msg } {0 120h} test convert_units-5.4.8.12 {Rappture::Units::convert, s->d} { list [catch {Rappture::Units::convert 5s -to d} msg] $msg } {0 5.78704e-05d} test convert_units-5.4.8.13 {Rappture::Units::convert, min->d} { list [catch {Rappture::Units::convert 5min -to d} msg] $msg } {0 0.00347222d} test convert_units-5.4.8.14 {Rappture::Units::convert, h->d} { list [catch {Rappture::Units::convert 5h -to d} msg] $msg } {0 0.208333d} test convert_units-5.4.8.15 {Rappture::Units::convert, d->d} { list [catch {Rappture::Units::convert 5d -to d} msg] $msg } {0 5d} #-------------------------------------------------------------------- # Pressure Conversions #-------------------------------------------------------------------- test convert_units-5.4.9.0 {Rappture::Units::convert, bar->Pa} { list [catch {Rappture::Units::convert 5bar -to Pa} msg] $msg } {0 500000Pa} test convert_units-5.4.9.1 {Rappture::Units::convert, bar->atm} { list [catch {Rappture::Units::convert 5bar -to atm} msg] $msg } {0 4.9346atm} test convert_units-5.4.9.2 {Rappture::Units::convert, bar->torr} { list [catch {Rappture::Units::convert 5bar -to torr} msg] $msg } {0 3750.3torr} test convert_units-5.4.9.3 {Rappture::Units::convert, bar->psi} { list [catch {Rappture::Units::convert 5bar -to psi} msg] $msg } {0 72.52psi} test convert_units-5.4.9.4 {Rappture::Units::convert, bar->bar} { list [catch {Rappture::Units::convert 5bar -to bar} msg] $msg } {0 5bar} test convert_units-5.4.9.5 {Rappture::Units::convert, atm->Pa} { list [catch {Rappture::Units::convert 5atm -to Pa} msg] $msg } {0 506625Pa} test convert_units-5.4.9.6 {Rappture::Units::convert, atm->atm} { list [catch {Rappture::Units::convert 5atm -to atm} msg] $msg } {0 5atm} test convert_units-5.4.9.7 {Rappture::Units::convert, atm->torr} { list [catch {Rappture::Units::convert 5atm -to torr} msg] $msg } {0 3800torr} test convert_units-5.4.9.8 {Rappture::Units::convert, atm->psi} { list [catch {Rappture::Units::convert 5bar -to psi} msg] $msg } {0 72.52psi} test convert_units-5.4.9.9 {Rappture::Units::convert, atm->bar} { list [catch {Rappture::Units::convert 5atm -to bar} msg] $msg } {0 5.06627bar} test convert_units-5.4.9.10 {Rappture::Units::convert, Pa->Pa} { list [catch {Rappture::Units::convert 5Pa -to Pa} msg] $msg } {0 5Pa} test convert_units-5.4.9.11 {Rappture::Units::convert, Pa->atm} { list [catch {Rappture::Units::convert 5Pa -to atm} msg] $msg } {0 4.9346e-05atm} test convert_units-5.4.9.12 {Rappture::Units::convert, Pa->torr} { list [catch {Rappture::Units::convert 5Pa -to torr} msg] $msg } {0 0.037503torr} test convert_units-5.4.9.13 {Rappture::Units::convert, Pa->psi} { list [catch {Rappture::Units::convert 5Pa -to psi} msg] $msg } {0 0.0007252psi} test convert_units-5.4.9.14 {Rappture::Units::convert, Pa->bar} { list [catch {Rappture::Units::convert 5Pa -to bar} msg] $msg } {0 5e-05bar} test convert_units-5.4.9.15 {Rappture::Units::convert, torr->Pa} { list [catch {Rappture::Units::convert 5torr -to Pa} msg] $msg } {0 666.613Pa} test convert_units-5.4.9.16 {Rappture::Units::convert, torr->atm} { list [catch {Rappture::Units::convert 5torr -to atm} msg] $msg } {0 0.006579atm} test convert_units-5.4.9.17 {Rappture::Units::convert, torr->torr} { list [catch {Rappture::Units::convert 5torr -to torr} msg] $msg } {0 5torr} test convert_units-5.4.9.18 {Rappture::Units::convert, torr->psi} { list [catch {Rappture::Units::convert 5torr -to psi} msg] $msg } {0 0.096685psi} test convert_units-5.4.9.19 {Rappture::Units::convert, torr->bar} { list [catch {Rappture::Units::convert 5torr -to bar} msg] $msg } {0 0.00666613bar} test convert_units-5.4.9.20 {Rappture::Units::convert, psi->Pa} { list [catch {Rappture::Units::convert 5psi -to Pa} msg] $msg } {0 34473.8Pa} test convert_units-5.4.9.21 {Rappture::Units::convert, psi->atm} { list [catch {Rappture::Units::convert 5psi -to atm} msg] $msg } {0 0.34023atm} test convert_units-5.4.9.22 {Rappture::Units::convert, psi->torr} { list [catch {Rappture::Units::convert 5psi -to torr} msg] $msg } {0 258.575torr} test convert_units-5.4.9.23 {Rappture::Units::convert, psi->psi} { list [catch {Rappture::Units::convert 5psi -to psi} msg] $msg } {0 5psi} test convert_units-5.4.9.24 {Rappture::Units::convert, psi->bar} { list [catch {Rappture::Units::convert 5psi -to bar} msg] $msg } {0 0.344738bar} test convert_units-5.4.9.25 {Rappture::Units::convert, psi->kPa} { list [catch {Rappture::Units::convert 5psi -to kPa} msg] $msg } {0 34.4738kPa} test convert_units-5.4.9.26 {Rappture::Units::convert, kPa->psi} { list [catch {Rappture::Units::convert 5kPa -to psi} msg] $msg } {0 0.7252psi} test convert_units-5.4.9.27 {Rappture::Units::convert, mmHg->torr} { list [catch {Rappture::Units::convert 5mmHg -to torr} msg] $msg } {0 5torr} test convert_units-5.4.9.28 {Rappture::Units::convert, torr->mmHg} { list [catch {Rappture::Units::convert 5torr -to mmHg} msg] $msg } {0 5mmHg} #-------------------------------------------------------------------- # Case Insensitive/Sensitive Unit Conversions #-------------------------------------------------------------------- test convert_units-5.4.10.1 {Rappture::Units::convert, torr->mmhg} { list [catch {Rappture::Units::convert 5torr -to mmhg} msg] $msg } {0 5mmHg} test convert_units-5.4.10.2 {Rappture::Units::convert, ToRr->mmhg} { list [catch {Rappture::Units::convert 5ToRr -to mmhg} msg] $msg } {0 5mmHg} test convert_units-5.4.10.3 {Rappture::Units::convert, kpa->PSI} { list [catch {Rappture::Units::convert 5kpa -to PSI} msg] $msg } {0 0.7252psi} test convert_units-5.4.10.4 {Rappture::Units::convert, KPA->PsI} { list [catch {Rappture::Units::convert 5KPA -to PsI} msg] $msg } {0 0.7252psi} test convert_units-5.4.10.5 {Rappture::Units::convert, Cm2/vS->M2/KVUS} { list [catch {Rappture::Units::convert 2Cm2/vS -to M2/KVUS} msg] $msg } {0 2e-07m2/kVus} #-------------------------------------------------------------------- # Magnetic Field Conversions #-------------------------------------------------------------------- test convert_units-5.4.11.0 {Rappture::Units::convert, T->G} { list [catch {Rappture::Units::convert 5T -to G} msg] $msg } {0 50000G} test convert_units-5.4.11.1 {Rappture::Units::convert, G->T} { list [catch {Rappture::Units::convert 5G -to T} msg] $msg } {0 0.0005T} test convert_units-5.4.11.2 {Rappture::Units::convert, G->mT} { list [catch {Rappture::Units::convert 50G -to mT} msg] $msg } {0 5mT} test convert_units-5.4.11.3 {Rappture::Units::convert, Mx->Wb} { list [catch {Rappture::Units::convert 5Mx -to Wb} msg] $msg } {0 5e-08Wb} test convert_units-5.4.11.4 {Rappture::Units::convert, Wb->Mx} { list [catch {Rappture::Units::convert 5e-8Wb -to Mx} msg] $msg } {0 5Mx} test convert_units-5.4.11.5 {Rappture::Units::convert, wB->mX} { list [catch {Rappture::Units::convert 5e-8wB -to mX} msg] $msg } {0 5Mx} #-------------------------------------------------------------------- # Rappture::Units::Search::for #-------------------------------------------------------------------- test search-for-6.0.0.1 {Rappture::Units::Search::for, 300K} { list [catch {Rappture::Units::Search::for 300K} msg] $msg } {0 K} test search-for-6.0.0.2 {Rappture::Units::Search::for, 300cm2/Vs} { list [catch {Rappture::Units::Search::for 300cm2/Vs} msg] $msg } {0 cm2/Vs} test search-for-6.0.0.3 {Rappture::Units::Search::for, cm2/Vs} { list [catch {Rappture::Units::Search::for cm2/Vs} msg] $msg } {0 cm2/Vs} test search-for-6.0.1.1 {Rappture::Units::Search::for, 4notaunit} { list [catch {Rappture::Units::Search::for 4notaunit} msg] $msg } {0 {}} test search-for-6.0.1.2 {Rappture::Units::Search::for, notaunit} { list [catch {Rappture::Units::Search::for notaunit} msg] $msg } {0 {}} test search-for-6.0.1.3 {Rappture::Units::Search::for, notaunit} { list [catch {Rappture::Units::Search::for ^&} msg] $msg } {0 {}} test search-for-6.0.1.4 {Rappture::Units::Search::for, notaunit} { list [catch {Rappture::Units::Search::for x44} msg] $msg } {0 {}} test search-for-6.0.1.5 {Rappture::Units::Search::for, notaunit} { list [catch {Rappture::Units::Search::for 3*44eV} msg] $msg } {0 {}} test search-for-6.0.2.0 {Rappture::Units::Search::for, case searches - m} { set unit "m" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 m 0 length} test search-for-6.0.2.1 {Rappture::Units::Search::for, case searches - M} { set unit "M" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 m 0 length} test search-for-6.0.2.2 {Rappture::Units::Search::for, case searches - mm} { set unit "mm" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 mm 0 length} test search-for-6.0.2.3 {Rappture::Units::Search::for, case searches - Mm} { set unit "Mm" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 Mm 0 length} test search-for-6.0.2.4 {Rappture::Units::Search::for, case searches - MM} { set unit "MM" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 Mm 0 length} test search-for-6.0.2.5 {Rappture::Units::Search::for, case searches - mM} { set unit "mM" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 mm 0 length} test search-for-6.0.2.6 {Rappture::Units::Search::for, case searches - ks} { set unit "ks" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 ks 0 time} test search-for-6.0.2.7 {Rappture::Units::Search::for, case searches - Ks} { set unit "Ks" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 ks 0 time} test search-for-6.0.2.8 {Rappture::Units::Search::for, case searches - kS} { set unit "kS" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 ks 0 time} test search-for-6.0.2.9 {Rappture::Units::Search::for, case searches - KS} { set unit "KS" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 ks 0 time} test search-for-6.0.2.10 {Rappture::Units::Search::for, case searches - sk} { set unit "sk" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 sK 0 time*temperature} test search-for-6.0.2.11 {Rappture::Units::Search::for, case searches - sK} { set unit "sK" set status1 [catch {Rappture::Units::Search::for $unit} runit] set status2 [catch {Rappture::Units::System::for $unit} type] list $status1 $runit $status2 $type } {0 sK 0 time*temperature} #-------------------------------------------------------------------- # Allow isspace whitespace in Rappture::Units #-------------------------------------------------------------------- test space-7.0.0.1 {check for spaces before value unit string} { list [catch {Rappture::Units::Search::for " 300K"} msg] $msg } {0 K} test space-7.0.0.2 {check for spaces after value unit string} { list [catch {Rappture::Units::Search::for "300K "} msg] $msg } {0 K} test space-7.0.0.3 {check for spaces before and after value unit string} { list [catch {Rappture::Units::Search::for " 300K "} msg] $msg } {0 K} test space-7.0.0.4 {check for spaces between value and unit string} { list [catch {Rappture::Units::Search::for " 300 K "} msg] $msg } {0 K} test space-7.0.0.5 {check for spaces between value and single unit string} { list [catch {Rappture::Units::Search::for "300 K"} msg] $msg } {0 K} test space-7.0.0.6 {check for spaces between value and multiple unit string} { list [catch {Rappture::Units::Search::for "300 Kft"} msg] $msg } {0 Kft} test space-7.0.0.7 {check for spaces around and between value and multiple unit string} { list [catch {Rappture::Units::Search::for " 300 Kft "} msg] $msg } {0 Kft} test space-7.0.0.8 {check for spaces between multiple unit string} { list [catch {Rappture::Units::Search::for "300 K ft"} msg] $msg } {0 Kft} test space-7.0.0.9 {check for spaces around and between multiple unit string} { list [catch {Rappture::Units::Search::for " 300 K ft "} msg] $msg } {0 Kft} test space-7.0.0.10 {check for spaces between multiple unit string with division} { list [catch {Rappture::Units::Search::for "300 K / ft"} msg] $msg } {0 K/ft} test space-7.0.0.11 {check for spaces between multiple unit string with multiplication} { list [catch {Rappture::Units::Search::for "300 K * ft"} msg] $msg } {0 Kft} test space-7.0.1.1 {check for tabs before value unit string} { list [catch {Rappture::Units::Search::for "\t300K"} msg] $msg } {0 K} test space-7.0.1.2 {check for tabs after value unit string} { list [catch {Rappture::Units::Search::for "300K\t"} msg] $msg } {0 K} test space-7.0.1.3 {check for tabs before and after value unit string} { list [catch {Rappture::Units::Search::for "\t300K\t"} msg] $msg } {0 K} test space-7.0.1.4 {check for tabs between value and unit string} { list [catch {Rappture::Units::Search::for "\t300\tK\t"} msg] $msg } {0 K} test space-7.0.1.5 {check for tabs between value and single unit string} { list [catch {Rappture::Units::Search::for "300\tK"} msg] $msg } {0 K} test space-7.0.1.6 {check for tabs between value and multiple unit string} { list [catch {Rappture::Units::Search::for "300\tKft"} msg] $msg } {0 Kft} test space-7.0.1.7 {check for tabs around and between value and multiple unit string} { list [catch {Rappture::Units::Search::for "\t300\tKft\t"} msg] $msg } {0 Kft} test space-7.0.1.8 {check for tabs between multiple unit string} { list [catch {Rappture::Units::Search::for "300\tK\tft"} msg] $msg } {0 Kft} test space-7.0.1.9 {check for tabs around and between multiple unit string} { list [catch {Rappture::Units::Search::for "\t300\tK\tft\t"} msg] $msg } {0 Kft} test space-7.0.1.10 {check for tabs between multiple unit string with division} { list [catch {Rappture::Units::Search::for "300\tK\t/\tft"} msg] $msg } {0 K/ft} test space-7.0.1.11 {check for tabs between multiple unit string with multiplication} { list [catch {Rappture::Units::Search::for "300\tK\t*\tft"} msg] $msg } {0 Kft} test space-7.0.2.1 {check for newlines before value unit string} { list [catch {Rappture::Units::Search::for "\n300K"} msg] $msg } {0 K} test space-7.0.2.2 {check for newlines after value unit string} { list [catch {Rappture::Units::Search::for "300K\n"} msg] $msg } {0 K} test space-7.0.2.3 {check for newlines before and after value unit string} { list [catch {Rappture::Units::Search::for "\n300K\n"} msg] $msg } {0 K} test space-7.0.2.4 {check for newlines between value and unit string} { list [catch {Rappture::Units::Search::for "\n300\nK\n"} msg] $msg } {0 K} test space-7.0.2.5 {check for newlines between value and single unit string} { list [catch {Rappture::Units::Search::for "300\nK"} msg] $msg } {0 K} test space-7.0.2.6 {check for newlines between value and multiple unit string} { list [catch {Rappture::Units::Search::for "300\nKft"} msg] $msg } {0 Kft} test space-7.0.2.7 {check for newlines around and between value and multiple unit string} { list [catch {Rappture::Units::Search::for "\n300\nKft\n"} msg] $msg } {0 Kft} test space-7.0.2.8 {check for newlines between multiple unit string} { list [catch {Rappture::Units::Search::for "300\nK\nft"} msg] $msg } {0 Kft} test space-7.0.2.9 {check for newlines around and between multiple unit string} { list [catch {Rappture::Units::Search::for "\n300\nK\nft\n"} msg] $msg } {0 Kft} test space-7.0.2.10 {check for newlines between multiple unit string with division} { list [catch {Rappture::Units::Search::for "300\nK\n/\nft"} msg] $msg } {0 K/ft} test space-7.0.2.11 {check for newlines between multiple unit string with multiplication} { list [catch {Rappture::Units::Search::for "300\nK\n*\nft"} msg] $msg } {0 Kft} # TODO: # add tests for space and tab, space and newline, tab and newline # add tests for bad characters &^%$#@!)(~`{}[]:;"'?><,.-_=+\ or | ::tcltest::cleanupTests return