logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Test::RandomResult - Test that results of a running code look random

Author

       perlancar <perlancar@cpan.org>

Bugs

       Please     report     any     bugs     or     feature     requests     on    the    bugtracker    website
       <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-RandomResult>

       When submitting a bug or request, please include a test-file or a patch to  an  existing  test-file  that
       illustrates the bug or desired feature.

Description

EARLYRELEASE.CURRENTLYHASNOTCHECKEDTHEDISTRIBUTIONOFRANDOMRESULTS.

Functions

results_look_random
       Usage:

        results_look_random { CODE... }, 'TEST NAME';
        results_look_random { CODE... }, OPT1=>VAL, OPT2=>VAL, ..., 'TEST NAME';

       Run code multiple times (by default 30 or more, see the "runs" option) and check if the results look
       random.

       Known options:

       •   runs

           Integer. Default 30 or more. Number of times to run CODE.

       •   between

           2-element array of numbers ("[$min, $max]"). Check that results are between $min and $max.

       •   min

           Number. Specify minimum value (inclusive).

       •   xmin

           Number. Specify minimum value (exclusive).

       •   max

           Number. Specify maximum value (inclusive).

       •   xmax

           Number. Specify maximum value (exclusive).

Homepage

       Please visit the project's homepage at <https://metacpan.org/release/Test-RandomResult>.

Name

       Test::RandomResult - Test that results of a running code look random

See Also

       Test::RandomResults

       Test::Stochastic

Source

       Source repository is at <https://github.com/perlancar/perl-Test-RandomResult>.

Synopsis

        use Test::More;
        use Test::RandomResult; # exports results_look_random

        results_look_random { your_func($arg) } 'your_func returns random result';
        results_look_random { your_func($arg) } between=>[1,10], 'your_func returns random between 1-10';
        ...
        done_testing;

Version

       This document describes version 0.001 of Test::RandomResult (from Perl distribution Test-RandomResult),
       released on 2019-07-17.

See Also