Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 63 lines (58 sloc) 2.513 kb
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
1 use v6;
2
3 use Test;
4 plan 49;
5
6 # smartlink to top and bottom of long table
7 # L<S03/Reduction operators/"Builtin reduce operators return the following identity values">
8 # L<S03/Reduction operators/"[Z]() # []">
9
10 is ([**] ()), 1, "[**] () eq 1 (arguably nonsensical)";
11 is ([*] ()), 1, "[*] () eq 1";
9171cb7 [t/spec]: Correct tests for failure from [/], [%], etc. ops.
pmichaud authored
12 ok( !([/] ()).defined, "[/] () should fail");
13 ok( !([%] ()).defined, "[%] () should fail");
14 ok( !([x] ()).defined, "[x] () should fail");
15 ok( !([xx] ()).defined, "[xx] () should fail");
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
16 is ([+&] ()), +^0, "[+&] () eq +^0";
9171cb7 [t/spec]: Correct tests for failure from [/], [%], etc. ops.
pmichaud authored
17 ok( !([+<] ()).defined, "[+<] () should fail");
18 ok( !([+>] ()).defined, "[+>] () should fail");
19 ok( !([~&] ()).defined, "[~&] () should fail");
20 ok( !([~<] ()).defined, "[~<] () should fail");
21 ok( !([~>] ()).defined, "[~>] () should fail");
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
22 is ([+] ()), 0, "[+] () eq 0";
23 is ([-] ()), 0, "[-] () eq 0";
24 is ([~] ()), '', "[~] () eq ''";
25 is ([+|] ()), 0, "[+|] () eq 0";
26 is ([+^] ()), 0, "[+^] () eq 0";
27 is ([~|] ()), '', "[~|] () eq ''";
28 is ([~^] ()), '', "[~^] () eq ''";
29 is ([&] ()).perl, all().perl, "[&] () eq all()";
30 is ([|] ()).perl, any().perl, "[|] () eq any()";
31 is ([^] ()).perl, one().perl, "[^] () eq one()";
32 is ([!==] ()), Bool::False, "[!==] () eq False";
33 is ([==] ()), Bool::True, "[==] () eq True";
34 is ([<] ()), Bool::True, "[<] () eq True";
35 is ([<=] ()), Bool::True, "[<=] () eq True";
36 is ([>] ()), Bool::True, "[>] () eq True";
37 is ([>=] ()), Bool::True, "[>=] () eq True";
38 is ([~~] ()), Bool::True, "[~~] () eq True";
39 is ([!~~] ()), Bool::False, "[!~~] () eq False";
40 is ([eq] ()), Bool::True, "[eq] () eq True)";
9171cb7 [t/spec]: Correct tests for failure from [/], [%], etc. ops.
pmichaud authored
41 #?rakudo skip "[!eq] not implemented"
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
42 is ([!eq] ()), Bool::False, "[!eq] () eq False";
43 is ([lt] ()), Bool::True, "[lt] () eq True";
44 is ([le] ()), Bool::True, "[le] () eq True";
45 is ([gt] ()), Bool::True, "[gt] () eq True";
46 is ([ge] ()), Bool::True, "[ge] () eq True";
47 is ([=:=] ()), Bool::True, "[=:=] () eq True";
48 is ([!=:=] ()), Bool::False, "[!=:=] () eq False";
49 is ([===] ()), Bool::True, "[===] () eq True";
50 is ([!===] ()), Bool::False, "[!===] () eq False";
9171cb7 [t/spec]: Correct tests for failure from [/], [%], etc. ops.
pmichaud authored
51 #?rakudo 9 skip "[...] not implemented"
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
52 is ([eqv] ()), Bool::True, "[eqv] () eq True";
53 is ([!eqv] ()), Bool::False, "[!eqv] () eq False";
54 is ([&&] ()), Bool::True, "[&&] () eq True";
55 is ([||] ()), Bool::False, "[||] () eq False";
56 is ([^^] ()), Bool::False, "[^^] () eq False";
57 is (defined ([//] ())), Bool::False, "[//] () not defined";
58 is (defined ([=] ())), Bool::False, "[=] () not defined";
59 is ([,] ()), (), "[,] () eq ()";
60 is ([Z] ()), [], "[Z] () eq []";
61
62 # need to add one elems list cases
Something went wrong with that request. Please try again.