Changeset 549 for trunk/src/tcl/tests


Ignore:
Timestamp:
Dec 7, 2006 3:45:47 AM (17 years ago)
Author:
dkearney
Message:

added function Rappture::Units::Search::for which takes in a string and searches for and returns units if they exist. the returned units will be valid rappture units

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tcl/tests/units.test

    r545 r549  
    44#   Rappture::Units::System::for
    55#   Rappture::Units::System::all
     6#   Rappture::Units::Search::for
    67#
    78# This file contains a collection of tests for one of the Rappture Tcl
     
    802803} {0 2e-07M2/KVUS}
    803804
     805#--------------------------------------------------------------------
     806# Rappture::Units::Search::for <units>
     807#--------------------------------------------------------------------
     808
     809test search-for-6.0.0.1 {Rappture::Units::Search::for, 300K} {
     810    list [catch {Rappture::Units::Search::for 300K} msg] $msg
     811} {0 K}
     812
     813test search-for-6.0.0.2 {Rappture::Units::Search::for, 300cm2/Vs} {
     814    list [catch {Rappture::Units::Search::for 300cm2/Vs} msg] $msg
     815} {0 cm2/Vs}
     816
     817test search-for-6.0.0.3 {Rappture::Units::Search::for, cm2/Vs} {
     818    list [catch {Rappture::Units::Search::for cm2/Vs} msg] $msg
     819} {0 cm2/Vs}
     820
     821test search-for-6.0.1.1 {Rappture::Units::Search::for, 4notaunit} {
     822    list [catch {Rappture::Units::Search::for 4notaunit} msg] $msg
     823} {0 {}}
     824
     825test search-for-6.0.1.2 {Rappture::Units::Search::for, notaunit} {
     826    list [catch {Rappture::Units::Search::for notaunit} msg] $msg
     827} {0 {}}
     828
     829test search-for-6.0.1.2 {Rappture::Units::Search::for, notaunit} {
     830    list [catch {Rappture::Units::Search::for ^&} msg] $msg
     831} {0 {}}
    804832
    805833::tcltest::cleanupTests
Note: See TracChangeset for help on using the changeset viewer.