Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 60 lines (47 sloc) 2.05 kb
58135b3 [t/spec] changed 'use v6-alpha;' to 'use v6;'
moritz authored
1 use v6;
e59bb4b [t] Test suite refactoring.
cosimo authored
2 use Test;
19614fb @moritz [S32] unfossile more tests
moritz authored
3 plan 35;
e59bb4b [t] Test suite refactoring.
cosimo authored
4
b8d99dd [t/spec] fix more smartlinks
moritz authored
5 # L<S32::Numeric/Real/"=item sign">
e59bb4b [t] Test suite refactoring.
cosimo authored
6
576906b [t] added named arg tests to trig and num functions
frew authored
7 =begin pod
e59bb4b [t] Test suite refactoring.
cosimo authored
8
9 Basic tests for the sign() builtin
10
626a59c [rakudo] add directives to S29-num/ and convert pod to pod6
particle authored
11 =end pod
e59bb4b [t] Test suite refactoring.
cosimo authored
12
c1b6061 [t/spec] Add tests for method form, Rats, and Num.
colomon authored
13 is(0.sign, 0, 'got the right sign for 0');
14 is(-100.sign, -1, 'got the right sign for -100');
15 is(100.sign, 1, 'got the right sign for 100');
16 is((3/2).sign, 1, 'got the right sign for 3/2');
17 is((-3/2).sign, -1, 'got the right sign for -3/2');
228ac82 [t/spec] Change 1.5e1 to 1.5e0 to test around current ng bug which makes...
colomon authored
18 is(1.5e0.sign, 1, 'got the right sign for 1.5e1');
19 is(-1.5e0.sign, -1, 'got the right sign for -1.5e1');
c1b6061 [t/spec] Add tests for method form, Rats, and Num.
colomon authored
20
bb0a8fa @lizmat Use isa-ok instead of isa_ok
lizmat authored
21 isa-ok(0.sign, Int, 'got the right type for 0');
22 isa-ok(-100.sign, Int, 'got the right type for -100');
23 isa-ok(100.sign, Int, 'got the right type for 100');
24 isa-ok((3/2).sign, Int, 'got the right type for 3/2');
25 isa-ok((-3/2).sign, Int, 'got the right type for -3/2');
26 isa-ok(1.5e0.sign, Int, 'got the right type for 1.5e1');
27 isa-ok(-1.5e0.sign, Int, 'got the right type for -1.5e1');
7ee4078 [t/spec] Add tests that sign returns Int.
colomon authored
28
e59bb4b [t] Test suite refactoring.
cosimo authored
29 is(sign(0), 0, 'got the right sign for 0');
30 is(sign(-100), -1, 'got the right sign for -100');
31 is(sign(100), 1, 'got the right sign for 100');
32 is(sign(1.5), 1, 'got the right sign for 1.5');
33 is(sign(-1.5), -1, 'got the right sign for -1.5');
c1b6061 [t/spec] Add tests for method form, Rats, and Num.
colomon authored
34 is(sign(1.5e1), 1, 'got the right sign for 1.5e1');
35 is(sign(-1.5e1), -1, 'got the right sign for -1.5e1');
0ec4e58 Tests for sign(x) with Inf and NaN
leto authored
36
bb0a8fa @lizmat Use isa-ok instead of isa_ok
lizmat authored
37 isa-ok(sign(0), Int, 'got the right type for 0');
38 isa-ok(sign(-100), Int, 'got the right type for -100');
39 isa-ok(sign(100), Int, 'got the right type for 100');
40 isa-ok(sign(1.5), Int, 'got the right type for 1.5');
41 isa-ok(sign(-1.5), Int, 'got the right type for -1.5');
42 isa-ok(sign(1.5e1), Int, 'got the right type for 1.5e1');
43 isa-ok(sign(-1.5e1), Int, 'got the right type for -1.5e1');
7ee4078 [t/spec] Add tests that sign returns Int.
colomon authored
44
0ec4e58 Tests for sign(x) with Inf and NaN
leto authored
45 is(sign(Inf), 1, 'got correct sign for +Inf');
7ee4078 [t/spec] Add tests that sign returns Int.
colomon authored
46 is(sign(-Inf), -1, 'got correct sign for -Inf');
bb0a8fa @lizmat Use isa-ok instead of isa_ok
lizmat authored
47 isa-ok(sign(Inf), Int, 'got correct type for +Inf');
48 isa-ok(sign(-Inf), Int, 'got correct type for -Inf');
38f4adc @colomon Fudge for nom.
colomon authored
49 #?rakudo todo "Nom does not yet have a NaN framework in place"
3a7da94 @coke niecza fudging
coke authored
50 #?niecza todo
0ec4e58 Tests for sign(x) with Inf and NaN
leto authored
51 is(sign(NaN),NaN, 'sign of NaN is NaN');
576906b [t] added named arg tests to trig and num functions
frew authored
52
3a7da94 @coke niecza fudging
coke authored
53 #?niecza todo
2544bcf @jdhore Remove most remaining .notdef's.
jdhore authored
54 nok sign(Int).defined, 'sign(Int) is undefined';
752484f @moritz Test that sign(Complex) dies correctly
moritz authored
55 throws_like { sign(3+4i) }, X::Numeric::Real;
96faf81 [t/spec] test for RT #60674, sign(Complex)
moritz authored
56
e76dd4c @moritz s/done_testing/done/ as per recent S24 changes
moritz authored
57 done;
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
58
59 # vim: ft=perl6
Something went wrong with that request. Please try again.