Test::...Result(3pm)

πŸ“¦
version 0.001 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay bestie, so this is the manual for Test::...Result(3pm) β€” and the actual module it's about is Test::RandomResult, which is a little test helper that checks whether the results of some running code look random. that's it. that's the whole job. slay. ✨


🌸 VERSION 🌸

this doc is describing version 0.001 of Test::RandomResult (out of the Perl distribution Test-RandomResult), and it was released on 2019-07-17. yeah she's an old queen but she's our old queen. πŸ’…


πŸ¦‹ 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;

no cap, that's the whole vibe. you import the thing, you hand it a block of code, you tell it what to call the test. πŸŽ€


✨ DESCRIPTION ✨

EARLY RELEASE. CURRENTLY HAS NOT CHECKED THE DISTRIBUTION OF RANDOM RESULTS.

😭 okay so listen β€” this is an early release and it has not checked the distribution of random results. like, at all. she's showing up to the function in a cute outfit and vibes alone. do not use this to certify anything cryptographically. please. for me.

🫢 FUNCTIONS 🫢

results_look_random

usage:

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

so the way this works: it runs your code multiple times (by default 30 or more, check the "runs" option for that) and then checks whether the results look random. it's giving "i know it when i see it" energy, honestly.

the known options are:

  • runs β€” an integer. default is 30 or more. this is how many times it's gonna run your CODE, bestie. πŸƒβ€β™€οΈ
  • between β€” a 2-element array of numbers, written like [$min, $max]. it checks that the results land between $min and $max. 🌈
  • min β€” a number. sets the minimum value, and it's inclusive.
  • xmin β€” a number. sets the minimum value, and it's exclusive.
  • max β€” a number. sets the maximum value, and it's inclusive.
  • xmax β€” a number. sets the maximum value, and it's exclusive.
πŸ’œ tiny note so nobody comes for me: min/max are inclusive, xmin/xmax are exclusive. that's the only difference. the x is doing the heavy lifting. iconic honestly.

πŸŽ€ HOMEPAGE πŸŽ€

go visit the project's homepage, she'd love the engagement: <https://metacpan.org/release/Test-RandomResult>


πŸ’œ SOURCE πŸ’œ

the source repository lives right here: <https://github.com/perlancar/perl-Test-RandomResult>


πŸ™ˆ BUGS πŸ™ˆ

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

and when you submit a bug or a request, please include a test-file β€” or a patch to an existing test-file β€” that illustrates the bug or the desired feature. like, show me the receipts, not just the feelings. πŸ“


⭐ SEE ALSO ⭐

  • Test::RandomResults
  • Test::Stochastic

πŸ‘‘ AUTHOR πŸ‘‘

perlancar <perlancar@cpan.org>


this software is copyright (c) 2019 by perlancar@cpan.org.

it's free software β€” you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. πŸ’…


and that's the whole page, bestie 🫢 this was Test::...Result(3pm) as generated by perl v5.34.0 on 2022-06-30. go write some tests that are lowkey random, and stay slay. 🌈✨

πŸ“¦ where this page comes from