Test::RandomCheck - Yet another QuickCheck for Perl
use Test::RandomCheck; use Test::RandomCheck::Generator; use Test::More; sub my_length { ... } # Define types of values which is used while testing. my $type_of_arguments = concat(string, string); random_ok { my ($s1, $s2) = @_; # Write a property which the my_length has. my_length($s1) + my_length($s2) == my_length($s1 . $s2); } $type_of_arguments; done_testing;
THIS IS EXPERIMENTAL!
Test::RandomCheck is an implementation of QuickCheck in Perl.
You may want to define any kind of test arguments by using conbinators prepared by Test::RandomCheck::Generator.
<random_ok { ... } $generator;
Run blocks with arguments generated by $generator. $generator must have arbitrary() method which returns the Test::RandomCheck::Generator instance.
It outputs "OK" if the block returns the true value for all random petterns.
http://hackage.haskell.org/package/QuickCheck is a test library for Haskell to define properties of functions and to run tests randomly.
Test::LectroTest is another implementation of QuickTest which uses the source code filter and has haskell like syntax (CamelCase class names).
Masahiro Honma <hiratara@cpan.org>
Copyright 2013- Masahiro Honma
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Test::RandomCheck, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::RandomCheck
CPAN shell
perl -MCPAN -e shell install Test::RandomCheck
For more information on module installation, please visit the detailed CPAN module installation guide.