DOKK / manpages / debian 12 / libtest-deep-fuzzy-perl / Test::Deep::Fuzzy.3pm.en
Test::Deep::Fuzzy(3pm) User Contributed Perl Documentation Test::Deep::Fuzzy(3pm)

Test::Deep::Fuzzy - fuzzy number comparison with Test::Deep

    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');

Test::Deep::Fuzzy provides fuzzy number comparison with Test::Deep.

Rounds the values before comparing the values. The RANGE is used for "Math::Round::nearest()" to compare the values.

Math::Round Test::Deep Test::Number::Delta

Copyright (C) karupanerura.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

karupanerura <karupa@cpan.org>

2022-06-17 perl v5.34.0