1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
[![Build Status](https://travis-ci.org/karupanerura/Test-Deep-Fuzzy.svg?branch=master)](https://travis-ci.org/karupanerura/Test-Deep-Fuzzy) [![Coverage Status](http://codecov.io/github/karupanerura/Test-Deep-Fuzzy/coverage.svg?branch=master)](https://codecov.io/github/karupanerura/Test-Deep-Fuzzy?branch=master)
# NAME
Test::Deep::Fuzzy - fuzzy number comparison with Test::Deep
# SYNOPSIS
```perl
use Test::Deep;
use Test::Deep::Fuzzy;
my $range = 0.001;
cmp_deeply({
number => 0.0078125,
}, {
number => is_fuzzy_num(0.008, $range),
}, 'number is collect');
```
# DESCRIPTION
Test::Deep::Fuzzy provides fuzzy number comparison with [Test::Deep](https://metacpan.org/pod/Test::Deep).
# FUNCTIONS
- **is\_fuzzy\_num** EXPECTED, RANGE
Rounds the values before comparing the values.
The RANGE is used for `Math::Round::nearest()` to compare the values.
# SEE ALSO
[Math::Round](https://metacpan.org/pod/Math::Round)
[Test::Deep](https://metacpan.org/pod/Test::Deep)
[Test::Number::Delta](https://metacpan.org/pod/Test::Number::Delta)
# LICENSE
Copyright (C) karupanerura.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
# AUTHOR
karupanerura <karupa@cpan.org>
|