2
# Copyright (C) 2007-2008, The Perl Foundation.
7
t/pmc/perl6multisub-type.t - Type based dispatch tests
11
% prove t/pmc/perl6multisub-type.t
15
Tests for type based dispatch using the Perl 6 MultiSub PMC.
19
.loadlib 'perl6_group'
22
.include 'include/test_more.pir'
23
load_bytecode "perl6.pbc"
27
'constraint_tiebreak'()
31
.sub 'constraint_tiebreak'
32
$P0 = new "Perl6MultiSub"
33
$P1 = get_global 'constraint_tiebreak_1'
35
'attach_sig'($P1, $P2)
37
$P1 = get_global 'constraint_tiebreak_2'
38
$P2 = get_global 'constraint_tiebreak_2_con'
39
'attach_sig'($P1, $P2)
45
is($I0, 2, 'constraint tie-breaks')
48
is($I0, 1, 'constraint tie-breaks')
50
.sub 'constraint_tiebreak_1'
54
.sub 'constraint_tiebreak_2'
58
.sub 'constraint_tiebreak_2_con'
66
.param pmc constraints :slurpy
70
any = get_hll_global 'Any'
74
$P1 = new 'Perl6Array'
75
setattribute $P0, "@!params", $P1
79
unless it goto param_loop_end
83
$P2["cons_type"] = con
84
$P2["multi_invocant"] = true
89
setprop sub, '$!signature', $P0
96
# vim: expandtab shiftwidth=4 ft=pir: