::xox::test
Class TestParseArgs

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
Tested Class:
::xox::ParseArgs

Class TestParseArgs
superclass ::xounit::TestCase,

Variables
NameDefault ValueClassComment
currentTestMethod    ::xounit::TestCase
 name of the currently running test method.
nodeName    ::xox::Node
 
result    ::xounit::TestCase
 the result for the current run.
 
Methods
NameComment
testFlag {}  
testParameter {}  
   
Methods from ::xotcl::Object
#, ., ?, ?code, ?methods, ?object, abstract, copy, coverageFilter, defaultmethod, extractConfigureArg, filterappend, garbageCollect, get#, getClean#, hasclass, init, methodTag, mixinappend, move, profileFilter, self, setParameterDefaults, shell, tclcmd, traceFilter,
 
Instproc Detail

testFlag

Description:
 
Code:
  ::xox::test::TestParseArgs instproc testFlag {}  {
   
        
        ::xox::ParseArgs create ::xox::test::ParseSomething

        my assertEquals [ ::xox::test::ParseSomething flags ] ""

        ::xox::test::ParseSomething addFlag hey

        my assertEquals [ ::xox::test::ParseSomething flags ] hey

        set o [ ::xox::test::ParseSomething parse -hey ]

        my assertEquals [ $o set hey ] 1
        my assertEquals [ $o ishey ] 1

        set p [ ::xox::test::ParseSomething parse  ]

        my assertEquals [ $p set hey ] 0
        my assertEquals [ $p ishey ] 0
    
}

testParameter

Description:
 
Code:
  ::xox::test::TestParseArgs instproc testParameter {}  {
   
        
        ::xox::ParseArgs create ::xox::test::ParseSomething2

        ParseSomething2 parameter {
            { aparam default }
        }

        set o [ ::xox::test::ParseSomething2 parse -aparam value ]
        my assertEquals [ $o aparam ] value

        set p [ eval ::xox::test::ParseSomething2 parse "-aparam value" ]
        my assertEquals [ $p aparam ] value
    
}