Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 182 lines (148 sloc) 4.243 kb
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
1 use v6;
2
3 use Test;
4
05c3d8d3 »
2011-08-11 re-attempt to fix smartlinks in S02 to headings that contain C<>
5 #L<S02/The C<Num> and C<Rat> Types/Perl 6 intrinsically supports big integers>
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
6
3548dd2c »
2012-01-07 Modernize tests a bit. Add new test. Unfudge for niecza.
7 plan 64;
f646c2d6 »
2009-10-18 [t/spec] Test Num.perl. Who'd have thought that 1.0.perl wouldn't wor…
8
616002e1 »
2012-03-01 pugs fudges
9 #?pugs 7 skip '.Num'
f646c2d6 »
2009-10-18 [t/spec] Test Num.perl. Who'd have thought that 1.0.perl wouldn't wor…
10 isa_ok( eval(1.Num.perl), Num, 'eval 1.Num.perl is Num' );
11 is_approx( eval(1.Num.perl), 1, 'eval 1.Num.perl is 1' );
12 isa_ok( eval(0.Num.perl), Num, 'eval 0.Num.perl is Num' );
13 is_approx( eval(0.Num.perl), 0, 'eval 0.Num.perl is 0' );
14 isa_ok( eval((-1).Num.perl), Num, 'eval -1.Num.perl is Num' );
15 is_approx( eval((-1).Num.perl), -1, 'eval -1.Num.perl is -1' );
3548dd2c »
2012-01-07 Modernize tests a bit. Add new test. Unfudge for niecza.
16 isa_ok( eval(1.1.Num.perl), Num, 'eval 1.1.Num.perl is Num' );
f646c2d6 »
2009-10-18 [t/spec] Test Num.perl. Who'd have thought that 1.0.perl wouldn't wor…
17 is_approx( eval(1.1.perl), 1.1, 'eval 1.1.Num.perl is 1.1' );
616002e1 »
2012-03-01 pugs fudges
18 #?pugs skip '.Num'
3548dd2c »
2012-01-07 Modernize tests a bit. Add new test. Unfudge for niecza.
19 isa_ok( eval((-1.1).Num.perl), Num, 'eval -1.1.Num.perl is Num' );
f646c2d6 »
2009-10-18 [t/spec] Test Num.perl. Who'd have thought that 1.0.perl wouldn't wor…
20 is_approx( eval((-1.1).perl), -1.1, 'eval -1.1.Num.perl is -1.1' );
616002e1 »
2012-03-01 pugs fudges
21 #?pugs 2 skip '.Num'
3548dd2c »
2012-01-07 Modernize tests a bit. Add new test. Unfudge for niecza.
22 isa_ok( eval(1e100.Num.perl), Num, 'eval 1e100.Num.perl is Num' );
23 is_approx( eval(1e100.Num.perl), 1e100, 'eval 1e100.Num.perl is 1' );
f646c2d6 »
2009-10-18 [t/spec] Test Num.perl. Who'd have thought that 1.0.perl wouldn't wor…
24
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
25 {
26 my $a = 1; "$a";
207f13f6 »
2008-12-25 [t] and [t/spec]
27 isa_ok($a, Int);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
28 is($a, "1", '1 stringification works');
29 }
30
31 {
32 my $a = -1; "$a";
207f13f6 »
2008-12-25 [t] and [t/spec]
33 isa_ok($a, Int);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
34 is($a, "-1", '-1 stringification works');
35 }
36
05c3d8d3 »
2011-08-11 re-attempt to fix smartlinks in S02 to headings that contain C<>
37 #L<S02/The C<Num> and C<Rat> Types/Rat supports extended precision rational arithmetic>
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
38 {
a4ba5fd8 »
2009-09-01 [t/spec] correct meaning of infix:<div> and infix:</>. Patch courtesy…
39 my $a = 1 / 1;
207f13f6 »
2008-12-25 [t] and [t/spec]
40 isa_ok($a, Rat);
685fe36f »
2009-09-01 [t/spec] fix Rat stringification in num.t
41 is(~$a, "1", '1/1 stringification works');
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
42 }
43
44 {
207f13f6 »
2008-12-25 [t] and [t/spec]
45 my $a = -1.0;
d08ca679 »
2010-02-28 [t/spec] Bring num.t up-to-date a bit, and fudge it for Rakudo.
46 isa_ok($a, Rat);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
47 is($a, "-1", '-1 stringification works');
48 }
49
50 {
207f13f6 »
2008-12-25 [t] and [t/spec]
51 my $a = 0.1;
d08ca679 »
2010-02-28 [t/spec] Bring num.t up-to-date a bit, and fudge it for Rakudo.
52 isa_ok($a, Rat);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
53 is($a, "0.1", '0.1 stringification works');
54 }
55
56 {
57 my $a = -0.1; "$a";
d08ca679 »
2010-02-28 [t/spec] Bring num.t up-to-date a bit, and fudge it for Rakudo.
58 isa_ok($a, Rat);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
59 is($a, "-0.1", '-0.1 stringification works');
60 }
61
62 {
63 my $a = 10.01; "$a";
d08ca679 »
2010-02-28 [t/spec] Bring num.t up-to-date a bit, and fudge it for Rakudo.
64 isa_ok($a, Rat);
65 is($a, "10.01", '10.01 stringification works');
66 }
67
68 {
69 my $a = -1.0e0;
70 isa_ok($a, Num);
71 is($a, "-1", '-1 stringification works');
72 }
73
74 {
75 my $a = 0.1e0;
76 isa_ok($a, Num);
77 is($a, "0.1", '0.1 stringification works');
78 }
79
80 {
81 my $a = -0.1e0; "$a";
82 isa_ok($a, Num);
83 is($a, "-0.1", '-0.1 stringification works');
84 }
85
86 {
87 my $a = 10.01e0; "$a";
207f13f6 »
2008-12-25 [t] and [t/spec]
88 isa_ok($a, Num);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
89 is($a, "10.01", '10.01 stringification works');
90 }
91
92 {
93 my $a = 1e3; "$a";
207f13f6 »
2008-12-25 [t] and [t/spec]
94 ok $a ~~ Num, '1e3 conforms to Num';
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
95 is($a, "1000", '1e3 stringification works');
96 }
97
98 {
99 my $a = 10.01e3; "$a";
207f13f6 »
2008-12-25 [t] and [t/spec]
100 isa_ok($a, Num);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
101 is($a, "10010", '10.01e3 stringification works');
102 }
103
05c3d8d3 »
2011-08-11 re-attempt to fix smartlinks in S02 to headings that contain C<>
104 #L<S02/The C<Num> and C<Rat> Types/Perl 6 intrinsically supports big integers>
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
105
106 {
107 my $a = 0b100; "$a";
207f13f6 »
2008-12-25 [t] and [t/spec]
108 isa_ok($a, Int);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
109 is($a, "4", '0b100 (binary) stringification works');
110 }
111
112 {
113 my $a = 0x100; "$a";
207f13f6 »
2008-12-25 [t] and [t/spec]
114 isa_ok($a, Int);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
115 is($a, "256", '0x100 (hex) stringification works');
116 }
117
118 {
119 my $a = 0o100; "$a";
207f13f6 »
2008-12-25 [t] and [t/spec]
120 isa_ok($a, Int);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
121 is($a, "64", '0o100 (octal) stringification works');
122 }
123
124 {
189b4dbe »
2009-05-06 [t/spec] cosmetic cleaning: remove trailing space
125 my $a = 1; "$a";
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
126 is($a + 1, 2, 'basic addition works');
127 }
128
129 {
130 my $a = -1; "$a";
131 ok($a + 1 == 0, 'basic addition with negative numbers works'); # parsing bug
132 }
05c3d8d3 »
2011-08-11 re-attempt to fix smartlinks in S02 to headings that contain C<>
133 #L<S02/The C<Num> and C<Rat> Types/Rat supports extended precision rational arithmetic>
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
134
a4ba5fd8 »
2009-09-01 [t/spec] correct meaning of infix:<div> and infix:</>. Patch courtesy…
135 isa_ok(1 / 1, Rat);
207f13f6 »
2008-12-25 [t] and [t/spec]
136
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
137 {
138 my $a = 80000.0000000000000000000000000;
0b50b2c2 »
2011-07-15 Fix a broken test in S02-builtin_data_types/num.t, defudge some passing
139 isa_ok($a, Rat);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
140 ok($a == 80000.0, 'trailing zeros compare correctly');
141 }
142
143 {
144 my $a = 1.0000000000000000000000000000000000000000000000000000000000000000000e1;
6e0e9d5c »
2009-07-22 Stop some tests in S02 assuming that a floating point literal like 1.…
145 isa_ok($a, Num);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
146 ok($a == 10.0, 'trailing zeros compare correctly');
147 }
148
05c3d8d3 »
2011-08-11 re-attempt to fix smartlinks in S02 to headings that contain C<>
149 #L<S02/The C<Num> and C<Rat> Types/Perl 6 intrinsically supports big integers>
616002e1 »
2012-03-01 pugs fudges
150 #?pugs skip '.Int'
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
151 {
152 my $a = "1.01";
4401e319 »
2011-12-22 Fix type test fossil
153 isa_ok($a.Int, Int);
e84b8181 »
2009-09-15 Kill off prefix:<int> (as per r25890)
154 is($a.Int, 1, "1.01 intifies to 1");
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
155 }
156
05c3d8d3 »
2011-08-11 re-attempt to fix smartlinks in S02 to headings that contain C<>
157 #L<S02/The C<Num> and C<Rat> Types/may be bound to an arbitrary>
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
158 {
159 my $a = "0d0101";
616002e1 »
2012-03-01 pugs fudges
160 #?pugs todo
0fd99d31 »
2011-07-14 start to systematically test string numification
161 isa_ok(+$a, Int);
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
162 is(+$a, 101, "0d0101 numifies to 101");
163 }
164
165 {
166 my $a = 2 ** 65; # over the 64 bit limit too
167 is($a, 36893488147419103232, "we have bignums, not weeny floats");
168 }
169
170 is(42_000, 42000, 'underscores allowed (and ignored) in numeric literals');
171 is(42_127_000, 42127000, 'multiple underscores ok');
172 is(42.0_1, 42.01, 'underscores in fraction ok');
173 is(4_2.01, 42.01, 'underscores in whole part ok');
174
b699884c »
2008-06-24 [spec] fudged num.t
175 eval_dies_ok('4_2._0_1', 'single underscores are not ok directly after the dot');
176 is(4_2.0_1, 42.01, 'single underscores are ok');
0ca4c116 »
2008-06-24 [gsoc_spectest] t/data_types/* -> t/spec/S02-builtin_data_types/
177
178 is 0_1, 1, "0_1 is parsed as 0d1";
179 is +^1, -2, '+^1 == -2 as promised';
7f29bc53 »
2009-08-08 [t/spec] Add vim: lines everywhere.
180
181 # vim: ft=perl6
Something went wrong with that request. Please try again.