Skip to content

Commit 6bc3067

Browse files
committed
pugs fudge
1 parent 7bbd58b commit 6bc3067

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

S06-multi/syntax.t

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ multi sub bar($a) { "one" } #OK not used
1919
#?niecza skip 'No candidates for dispatch to &bar'
2020
is(bar(), "empty", "multi sub with no signature");
2121
#?niecza skip 'Ambiguous dispatch for &bar'
22+
#?pugs todo
2223
is(bar(42), "one", "multi sub with parameter list");
2324

2425
# multi without a routine type
@@ -27,6 +28,7 @@ multi baz($a) { "one" } #OK not used
2728
#?niecza skip 'No candidates for dispatch to &baz'
2829
is(baz(), "empty", "multi with no signature");
2930
#?niecza skip 'Ambiguous dispatch for &baz'
31+
#?pugs todo
3032
is(baz(42), "one", "multi with parameter list");
3133

3234
# multi without a routine type with signature
@@ -48,8 +50,10 @@ multi bar(S $a;; T $b) { 1 } #OK not used
4850
multi bar(T $a;; S $b) { 2 } #OK not used
4951
my $lived = 0;
5052
try { foo(S,S); $lived = 1 }
53+
#?pugs todo
5154
is($lived, 0, "dispatch tied as expected");
5255
#?niecza skip 'Ambiguous dispatch for &bar'
56+
#?pugs skip 'missing invocant'
5357
is(bar(S,S), 1, "not tied as only first type in the dispatch");
5458

5559
# not allowed to declare anonymous routines with only, multi or proto.
@@ -68,16 +72,20 @@ eval_dies_ok 'class C { proto method {} }', 'anonymous proto method is an error'
6872

6973
#?rakudo skip 'Multi typename...maybe deprecated?'
7074
#?niecza skip 'Undeclared name Multi'
75+
#?pugs skip 'Undeclared name Multi'
7176
ok(&foo ~~ Multi, 'a multi does Multi');
77+
#?pugs skip 'Callable'
7278
ok(&foo ~~ Callable, 'a multi does Callable');
7379
#?niecza todo
80+
#?pugs skip 'parsefail'
7481
ok(~&foo ~~ /foo/, 'a multi stringifies sensibly');
7582

7683
# note - example in ticket [perl #58948] a bit more elaborate
7784
{
7885
multi sub max($a, $b, $c) {return 9} #OK not used
7986

8087
lives_ok { max(1, 2, 3) }, 'use multi method to override builtin lives';
88+
#?pugs todo
8189
is eval('max(1, 2, 3)'), 9, 'use multi method to override builtin';
8290
}
8391

@@ -96,19 +104,23 @@ ok(~&foo ~~ /foo/, 'a multi stringifies sensibly');
96104
{
97105
multi rt68234(:$key!) { 'with key' }; #OK not used
98106
multi rt68234(*%_) { 'unknown' }; #OK not used
107+
#?pugs todo
99108
is rt68234(:key), 'with key', 'can find multi method with key';
109+
#?pugs skip 'Named argument found where no matched parameter expected'
100110
is rt68234(:unknown), 'unknown', 'can find multi method with slurpy';
101111
}
102112

103113
# RT #68158
104114
{
105115
multi rt68158() { 1 }
106116
multi rt68158(*@x) { 2 } #OK not used
117+
#?pugs todo
107118
is rt68158(), 1, 'non-slurpy wins over slurpy';
108119
is rt68158(9), 2, 'slurpy called when non-slurpy can not bind';
109120
}
110121

111122
# RT #64922
123+
#?pugs todo
112124
{
113125
multi rt64922($x, %h?) { 1 } #OK not used
114126
multi rt64922(@x) { 2 } #OK not used
@@ -126,6 +138,7 @@ ok(~&foo ~~ /foo/, 'a multi stringifies sensibly');
126138

127139
# We had a bug where the multiness leaked into a sub, so we got errors
128140
# about anonymous methods not being allowed to be multi.
141+
#?pugs skip 'parsefail'
129142
{
130143
multi sub kangaroo() { return method () { self * 2 } }
131144
my $m = kangaroo();
@@ -136,6 +149,7 @@ ok(~&foo ~~ /foo/, 'a multi stringifies sensibly');
136149
# RT #75136
137150
# a multi declaration should only return the current candidate, not the whole
138151
# set of candidates.
152+
#?pugs skip 'parsefail'
139153
{
140154
multi sub koala(Int $x) { 42 * $x };
141155

@@ -148,6 +162,7 @@ ok(~&foo ~~ /foo/, 'a multi stringifies sensibly');
148162

149163
multi with_cap($a) { $a }
150164
multi with_cap($a,$b,|$cap) { return with_cap($a + $b, |$cap) }
165+
#?pugs skip 'with_cap not found'
151166
is with_cap(1,2,3,4,5,6), 21, 'captures in multi sigs work';
152167

153168
done;

0 commit comments

Comments
 (0)