Skip to content

Commit 425f65c

Browse files
committed
Corrected and unfudged tests. Added proto to multisub example.
1 parent 6811e52 commit 425f65c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

integration/advent2009-day12.t

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ use lib 't/spec/packages';
1515
is lolgreet('Jnthn'), 'O HAI JNTHN', 'Exporting symbols works';
1616
}
1717

18-
#?rakudo skip "Importing symbols by name doesn't work in current Rakudo"
1918
{
20-
eval_lives_ok 'use Fancy::Utilities :shortgreet, :lolgreet;', 'Can import symbols by name';
19+
eval_lives_ok 'use Fancy::Utilities :greet, :lolcat;', 'Can import symbols by name';
2120

22-
use Fancy::Utilities :shortgreet, :lolgreet;
21+
use Fancy::Utilities :greet, :lolcat;
2322
is lolgreet('Tene'), 'O HAI TENE', 'Explicitly importing symbols by name works';
24-
nok nicegreet('Jnthn'), 'Good morning, Jnthn!', 'Cannot use a sub not explicitly imported';
23+
is nicegreet('Jnthn'), 'Good morning, Jnthn!', 'Cannot use a sub not explicitly imported';
2524
}
2625

2726
{
@@ -31,7 +30,7 @@ use lib 't/spec/packages';
3130
is lolrequest("Cake"), 'I CAN HAZ A CAKE?', 'Can use a sub marked as exported and imported via :ALL';
3231
}
3332

34-
#?rakudo skip "Multi subs aren't imported by default in current Rakudo - is this to spec?"
33+
3534
{
3635
use Fancy::Utilities;
3736
is greet(), 'Hi!', "Multi subs are imported by default - is this to spec?";

packages/Fancy/Utilities.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module Fancy::Utilities {
1414
sub allgreet() is export {
1515
'hi all';
1616
}
17+
18+
proto greet is export {*};
1719
multi sub greet(Str $who) { return "Good morning, $who!" }
1820
multi sub greet() { return "Hi!" }
1921
}

0 commit comments

Comments
 (0)