-
-
18 Sep 2013 05:09:24 UTC
- Distribution: Test-Power
- Module version: 0.08
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (138 / 0 / 20)
- Kwalitee
Bus factor: 1- License: perl_5
- Perl: v5.14.0
- Activity
24 month- Tools
- Download (11.49KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 2 contributors-
tokuhirom
-
adrian.candos
NAME
Test::Power - With great power, comes great responsibility.
SYNOPSIS
use Test::Power; sub foo { 4 } expect { foo() == 3 }; expect { foo() == 4 };
Output:
not ok 1 - L12 : expect { foo() == 3 }; # Failed test 'L12 : ok { foo() == 3 };' # at foo.pl line 12. # foo() # => 4 ok 2 - L13 : expect { foo() == 4 }; 1..2 # Looks like you failed 1 test of 2.
DESCRIPTION
WARNINGS: This module is currently on ALPHA state. Any APIs will change without notice. Notice that since this module uses the B power, it may cause segmentation fault.
WARNINGS AGAIN: Current version of Test::Power does not support ithreads.
Test::Power is yet another testing framework.
Test::Power shows progress data if it fails. For example, here is a testing script using Test::Power. This test may fail.
use Test::Power; sub foo { 3 } expect { foo() == 2 }; done_testing;
Output is:
not ok 1 - L6: expect { foo() == 2 }; # foo() # => 3 1..1
Woooooooh! It's pretty magical.
Test::Power
shows the calculation progress! You don't need to use different functions for different testing types, like ok, cmp_ok, is...EXPORTABLE FUNCTIONS
expect(&code)
-
expect { $foo };
This simply runs the
&code
, and uses that to determine if the test succeeded or failed. A true expression passes, a false one fails. Very simple.
REQUIRED PERL VERSION
Perl5.14+ is required. 5.14+ provides better support for custom ops. B::Tap required this. Under 5.14, perl5 can't do B::Deparse.
Patches welcome to support 5.12, 5.10, 5.8.
LICENSE
Copyright (C) tokuhirom.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
tokuhirom <tokuhirom@gmail.com>
SEE ALSO
Module Install Instructions
To install Test::Power, copy and paste the appropriate command in to your terminal.
cpanm Test::Power
perl -MCPAN -e shell install Test::Power
For more information on module installation, please visit the detailed CPAN module installation guide.