Skip to content

Commit

Permalink
Get Test::Util to export a proto rather than dubiously exporting each…
Browse files Browse the repository at this point in the history
… of the multi individual candidates. This makes it, and tests that use it, usable again.
  • Loading branch information
jnthn committed Aug 7, 2011
1 parent 27617a5 commit d8050f5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/Test/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ use Test;

# Tests for this testing code may be in the pugs repo under t/03-test-util/

proto sub is_run(|$) is export(:DEFAULT) { * }

# No input, no test name
multi sub is_run( Str $code, %expected, :@args ) is export(:DEFAULT) {
multi sub is_run( Str $code, %expected, :@args ) {
return is_run( $code, '', %expected, '', :@args );
}

# Has input, but not a test name
multi sub is_run( Str $code, Str $input, %expected, :@args ) is export(:DEFAULT) {
multi sub is_run( Str $code, Str $input, %expected, :@args ) {
return is_run( $code, $input, %expected, '', :@args );
}

# No input, named
multi sub is_run( Str $code, %expected, Str $name, :@args ) is export(:DEFAULT) {
multi sub is_run( Str $code, %expected, Str $name, :@args ) {
return is_run( $code, '', %expected, $name, :@args );
}

multi sub is_run( Str $code, Str $input, %expected, Str $name, :@args ) is export(:DEFAULT) {
multi sub is_run( Str $code, Str $input, %expected, Str $name, :@args ) {
my %got = get_out( $code, $input, :@args );

# The test may have executed, but if so, the results couldn't be collected.
Expand Down

0 comments on commit d8050f5

Please sign in to comment.