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::Deep::Fuzzy - fuzzy number comparison with Test::Deep

Author

       karupanerura <karupa@cpan.org>

perl v5.36.0                                       2023-07-01                             Test::Deep::Fuzzy(3pm)

Description

       Test::Deep::Fuzzy provides fuzzy number comparison with 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.

License

       Copyright (C) karupanerura.

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

Name

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

See Also

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

Synopsis

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

See Also