From Test::Simple to Test::Extreme - Various Testing Domains 29

Testing Domains

  • Test::Env - test the environment

        env_ok(NAME, VALUE)
    
  • Test::Exception provides routines to report whether code lives or dies, and whether code throws the correct exceptions

        dies_ok {$foo->method1} 'expecting to die';
        lives_ok {$foo->method2} 'expecting to live';
    
  • Test::File - test file attributes

        file_exists_ok( FILENAME [, NAME ] )
        file_readable_ok( FILENAME [, NAME ] )
        ...
    
  • Test::Data - test functions for particular variable types

        blessed_ok( SCALAR )      # Ok if the SCALAR is a
                                  # blessed reference.
    
        weak_ok( SCALAR )         # Ok if the SCALAR is a weak
                                  # reference.
    
        array_multiple_ok( ITEM, ARRAY [, NAME] ) # Ok if more than
                                                  # one element of
                                                  # ARRAY is ITEM.
    
  • Test::Differences - Test strings and data structures and show differences if not ok

 

YAPC::CA << Previous | Index | Next >>
Copyright © 2003 Michael Graham