2 # Copyright (C) 2001-2007, The Perl Foundation.
7 t/pmc/multisub.t - Multi Sub PMCs
11 % prove t/pmc/multisub.t
15 Tests the creation and invocation of Perl6 multi subs.
21 load_bytecode 'library/Test/More.pir'
23 .local pmc exports, curr_namespace, test_namespace
24 curr_namespace = get_namespace
25 test_namespace = get_namespace [ "Test::More" ]
26 exports = split " ", "plan ok is"
27 test_namespace.export_to(curr_namespace, exports)
36 is($I0, 0, "multisubs start empty")
39 is($S0, "testing no arg", "no argument variant")
41 is($S0, "testing hello", "single string variant")
43 is($S0, "testing 5", "single int variant")
44 $S0 = foo(42, "goodbye")
45 is($S0, "testing 42, goodbye", "int and string variant")
50 .return ('testing no arg')
53 .sub foo :multi(string)
55 $S0 = "testing " . bar
62 $S0 = "testing " . $S1
66 .sub foo :multi(int, string)
70 $S0 = "testing " . $S1
80 # vim: expandtab shiftwidth=4: