Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 60 lines (49 sloc) 1.34 kb
58135b3 [t/spec] changed 'use v6-alpha;' to 'use v6;'
moritz authored
1 use v6;
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
2 use Test;
085eb42 RT #70730 test added
bbkr authored
3 plan 13;
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
4
05c3d8d @diakopter re-attempt to fix smartlinks in S02 to headings that contain C<>
diakopter authored
5 # L<S02/"Infinity and C<NaN>" /Perl 6 by default makes standard IEEE floating point concepts visible>
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
6
7 {
8 my $x = Inf;
e596d2c [t/spec]: unfudge some tests relating to Inf/NaN .
pmichaud authored
9
10 ok( $x == Inf , 'numeric equal');
4bdf17e @coke Convert niecza faux-todo to real todo.
coke authored
11 #?niecza todo
e596d2c [t/spec]: unfudge some tests relating to Inf/NaN .
pmichaud authored
12 ok( $x eq 'Inf', 'string equal');
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
13 }
14
15 {
16 my $x = -Inf;
e596d2c [t/spec]: unfudge some tests relating to Inf/NaN .
pmichaud authored
17 ok( $x == -Inf, 'negative numeric equal' );
4bdf17e @coke Convert niecza faux-todo to real todo.
coke authored
18 #?niecza todo
e596d2c [t/spec]: unfudge some tests relating to Inf/NaN .
pmichaud authored
19 ok( $x eq '-Inf', 'negative string equal' );
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
20 }
21
82f7dc2 @moritz s/todo/skip/ some Inf related tests which bigint branch will break co…
moritz authored
22 #?rakudo skip 'integer Inf'
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
23 {
e84b818 Kill off prefix:<int> (as per r25890)
moritz authored
24 my $x = Inf.Int;
e596d2c [t/spec]: unfudge some tests relating to Inf/NaN .
pmichaud authored
25 ok( $x == Inf, 'int numeric equal' );
4bdf17e @coke Convert niecza faux-todo to real todo.
coke authored
26 #?niecza todo
e596d2c [t/spec]: unfudge some tests relating to Inf/NaN .
pmichaud authored
27 ok( $x eq 'Inf', 'int string equal' );
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
28 }
29
82f7dc2 @moritz s/todo/skip/ some Inf related tests which bigint branch will break co…
moritz authored
30 #?rakudo skip 'integer Inf'
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
31 {
e84b818 Kill off prefix:<int> (as per r25890)
moritz authored
32 my $x = ( -Inf ).Int;
e596d2c [t/spec]: unfudge some tests relating to Inf/NaN .
pmichaud authored
33 ok( $x == -Inf, 'int numeric equal' );
4bdf17e @coke Convert niecza faux-todo to real todo.
coke authored
34 #?niecza todo
e596d2c [t/spec]: unfudge some tests relating to Inf/NaN .
pmichaud authored
35 ok( $x eq '-Inf', 'int string equal' );
2aafe50 [t/spec] Infinity tests moved to S02-builtin-types
cosimo authored
36 }
37
38 # Inf should == Inf. Additionally, Inf's stringification (~Inf), "Inf", should
39 # eq to the stringification of other Infs.
40 # Thus:
41 # Inf == Inf # true
42 # and:
43 # Inf eq Inf # same as
44 # ~Inf eq ~Inf # true
e6382da [t/spec] truncate() on Inf and NaN
kyle authored
45
b192c0c [t/spec] tests for (Inf|NaN|-Inf).Int
moritz authored
46 ok truncate(Inf) ~~ Inf, 'truncate(Inf) ~~ Inf';
82f7dc2 @moritz s/todo/skip/ some Inf related tests which bigint branch will break co…
moritz authored
47 #?rakudo 3 skip 'Int conversion of NaN and Inf'
bd0cef4 @coke niecza fudging.
coke authored
48 #?niecza 3 todo
b192c0c [t/spec] tests for (Inf|NaN|-Inf).Int
moritz authored
49 ok NaN.Int === NaN, 'Inf.Int === Int';
50 ok Inf.Int === Inf, 'Inf.Int === Int';
51 ok (-Inf).Int === (-Inf), 'Inf.Int === Int';
52
085eb42 RT #70730 test added
bbkr authored
53 # RT #70730
4bdf17e @coke Convert niecza faux-todo to real todo.
coke authored
54 #?niecza todo
085eb42 RT #70730 test added
bbkr authored
55 {
56 ok ( rand * Inf ) === Inf, 'multiply rand by Inf without maximum recursion depth exceeded';
57 }
58
b192c0c [t/spec] tests for (Inf|NaN|-Inf).Int
moritz authored
59 # vim: ft=perl6
Something went wrong with that request. Please try again.