From Test::Simple to Test::Extreme - Bonus Material 52

Testing Domains

Various other Testing Domains

  • Test::ManyParams - test subroutine against many different inputs

    • test one sub against many arguments:

          all_ok {bar(shift())}
                 [qw/arg1 arg2 arg3 arg4 arg5 arg6/],
                 "Testing every argument with bar";
      
  • Test::Differences - Test strings and data structures and show differences if not ok

  • Test::Env - test the environment

    • provides env_ok(NAME, VALUE) for testing values of environment strings

  • Test::File - test file attributes

    • many tests for file attributes, e.g.:

          file_exists_ok( FILENAME [, NAME ] )
          file_readable_ok( FILENAME [, NAME ] )
          file_not_empty_ok( FILENAME [, NAME ] )
          file_size_ok( FILENAME, SIZE [, NAME ] )
          file_max_size_ok( FILENAME, MAX [, NAME ] )
          file_executable_ok( FILENAME [, NAME ] )
          ...
      
  • Test::Warn - test methods for warnings

    • test that functions throw appropriate warnings in given situations, e.g.:

          warning_is    {foo(-dri => "/")} "Unknown Parameter 'dri'",
                                           "dri != dir gives warning";
          warnings_are  {bar(1,1)} ["Width very small", "Height very small"];
          warning_is    {add(2,2)} undef, "No warning to calc 2+2";
      

 

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