Skip to content

Commit

Permalink
Move "is test-assertion" to candidates
Browse files Browse the repository at this point in the history
Apparently, it is not being seen if it just lives on the proto,
probably because the proto is not seen in callframe walking?
  • Loading branch information
lizmat committed Nov 22, 2020
1 parent 551b679 commit 15ec4fe
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions t/packages/Test/Helpers.pm6
Expand Up @@ -48,13 +48,13 @@ sub is-run (
}
}

proto sub is-run-repl(|) is export is test-assertion {*}
multi sub is-run-repl($code, $out, $desc, |c) {
proto sub is-run-repl(|) is export {*}
multi sub is-run-repl($code, $out, $desc, |c) is test-assertion {
is-run-repl $code, $desc, :$out, |c;
}
multi sub is-run-repl(
$code is copy, $desc, :$out = '', :$err = '', :$line-editor = 'none'
) {
) is test-assertion {
$code .= join: "\n" if $code ~~ Positional|Seq;
(temp %*ENV)<RAKUDO_ERROR_COLOR RAKUDO_LINE_EDITOR> = 0, $line-editor;
my $proc = run $*EXECUTABLE, '--repl-mode=interactive', :in, :out, :err;
Expand All @@ -80,8 +80,10 @@ multi sub is-run-repl(
}, $desc;
}

proto sub doesn't-hang(|) is export is test-assertion {*}
multi sub doesn't-hang(Str $args, $desc, :$in, :$wait = 15, :$out, :$err) {
proto sub doesn't-hang(|) is export {*}
multi sub doesn't-hang(
Str $args, $desc, :$in, :$wait = 15, :$out, :$err
) is test-assertion {
doesn't-hang \($*EXECUTABLE.absolute, '-e', $args), $desc,
:$in, :$wait, :$out, :$err;
}
Expand All @@ -92,7 +94,7 @@ my $VM-time-scale-multiplier = $*VM.name eq 'jvm' ?? 20/3 !! 1;
multi sub doesn't-hang (
Capture $args, $desc = 'code does not hang',
:$in, :$wait = 15, :$out, :$err,
) {
) is test-assertion {
my $prog = Proc::Async.new: |$args;
my ($stdout, $stderr) = '', '';
$prog.stdout.tap: { $stdout ~= $^a };
Expand Down

0 comments on commit 15ec4fe

Please sign in to comment.