Skip to content

Commit

Permalink
Test β‰… works correctly with infinities
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Oct 19, 2016
1 parent 157f9a2 commit ab4bbc6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S03-operators/relational.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 171;
plan 179;

## N.B.: Tests for infix:Β«<=>Β» (spaceship) and infix:<cmp> belong
## in F<t/S03-operators/comparison.t>.
Expand Down Expand Up @@ -208,6 +208,15 @@ is sqrt((-1).Complex) β‰… 0+1i, True, "can use approximate on Complex with negli
is sqrt((-1).Complex) β‰… 0+2i, False, "can use approximate on Complex with non-negligible real";
is sqrt((-1).Complex) β‰… 0+(1+1e-17)i, True, "can use approximate on Complex";

is-deeply ∞ β‰… ∞, Bool::True, ' ∞ β‰… ∞ gives True';
is-deeply -∞ β‰… -∞, Bool::True, '-∞ β‰… -∞ gives True';
is-deeply ∞ =~= ∞, Bool::True, ' ∞ =~= ∞ gives True';
is-deeply -∞ =~= -∞, Bool::True, '-∞ =~= -∞ gives True';
is-deeply ∞ β‰… -∞, Bool::False, ' ∞ β‰… -∞ gives False';
is-deeply -∞ β‰… ∞, Bool::False, '-∞ β‰… ∞ gives False';
is-deeply ∞ =~= -∞, Bool::False, ' ∞ =~= -∞ gives False';
is-deeply -∞ =~= ∞, Bool::False, '-∞ =~= ∞ gives False';

{
my $*TOLERANCE = 0.1;
ok 1.01 =~= 1, '=~= pays attention to $*TOLERANCE (More)';
Expand Down

0 comments on commit ab4bbc6

Please sign in to comment.