Skip to content

Commit

Permalink
Fix REPL breakage from last commit
Browse files Browse the repository at this point in the history
Need to explicitly stringify DepSpec if we gonna .contains it.

REPL testing routines explicitly request the `none` REPL line
editor, so the exploding logic that tries to figure out line
editor to use was never exercised.
  • Loading branch information
zoffixznet committed Mar 4, 2018
1 parent 207313b commit 89f33bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/REPL.pm6
Expand Up @@ -180,7 +180,7 @@ do {
CATCH {
when {
$_ ~~ X::CompUnit::UnsatisfiedDependency
and .specification.contains: $module-name
and .specification.Str.contains: $module-name
} {
# ignore it
}
Expand Down
12 changes: 11 additions & 1 deletion t/02-rakudo/repl.t
Expand Up @@ -3,7 +3,7 @@ use lib <t/packages>;
use Test;
use Test::Helpers;

plan 41;
plan 42;

my $*REPL-SCRUBBER = -> $_ is copy {
s/^^ "You may want to `zef install Readline` or `zef install Linenoise`"
Expand All @@ -15,6 +15,16 @@ my $*REPL-SCRUBBER = -> $_ is copy {
$_
}

subtest 'sanity check; load without tweaking line editor' => {
plan 3;
my $p := run $*EXECUTABLE, '--repl-mode=interactive', :in, :out, :err;
$p.in.say: '133742.flip.say';
$p.in.close;
like $p.out.slurp(:close), /247331/, 'result of code is on STDOUT';
is $p.err.slurp(:close).chars, 0, 'no STDERR output';
is $p.exitcode, 0, 'successful exit code';
}

# RT #123187
is-run-repl «'my int $t=4; $t.say;' '$t.say'», <4 4>,
'can use native typed variable on subsequent lines (1)';
Expand Down

0 comments on commit 89f33bb

Please sign in to comment.