Skip to content
Permalink
Browse files

Add tests for 'use isms' and 'use isms <C++>'

  • Loading branch information...
lizmat committed Sep 12, 2018
1 parent c6c2b6c commit 528def486144e828c3c2c8b57e585bdc7a41ab9f
Showing with 21 additions and 5 deletions.
  1. +21 −5 t/01-sanity/56-use-isms.t
@@ -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.
You can’t perform that action at this time.