Skip to content

Commit

Permalink
Add tests for 'use isms' and 'use isms <C++>'
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 12, 2018
1 parent c6c2b6c commit 528def4
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions t/01-sanity/56-use-isms.t
Expand Up @@ -3,9 +3,25 @@ use v6;
use lib <lib>;
use Test;

plan 2;
plan 8;

my $ran;
lives-ok { EVAL('use isms <Perl5>; sub abs() { $ran = True }; abs') },
'Can we run p5ish code without it complaining';
ok $ran, 'Did the code actually run';
for '', ' <Perl5>' -> $ism {
my $ran;
lives-ok { EVAL("
use isms$ism;
sub abs() \{ \$ran = True };
abs
") }, 'Can we run p5ish code without it complaining';
ok $ran, "Did the code with 'use isms$ism' actually run";
}

for '', ' <C++>' -> $ism {
my $ran;
lives-ok { EVAL("
use isms$ism;
sub new(\\a,|c) \{ a.new(|c) }
\$ran = new Str, :value<foo>;
") },
'Can we run C++ish code without it complaining';
is $ran, 'foo', "Did the code with 'use isms$ism' actually run";
}

0 comments on commit 528def4

Please sign in to comment.