Skip to content

Commit

Permalink
[v6.d REVIEW] Use preciser test routines
Browse files Browse the repository at this point in the history
So they give better output when failing.
Orig: 91f9a91
  • Loading branch information
zoffixznet committed Dec 23, 2017
1 parent 17e1dda commit 6fa5f64
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions S11-modules/require.t
@@ -1,13 +1,15 @@
use v6;

use lib $?FILE.IO.parent.parent, $?FILE.IO.parent.child("lib").Str;

use lib $?FILE.IO.parent.parent, $?FILE.IO.parent.child("lib").Str,
't/spec/packages';
use Test::Util;
use MONKEY-SEE-NO-EVAL;

my $required-Test = (require Test <&plan &is &lives-ok &skip &todo
my $required-Test = (require Test <&plan &is &lives-ok &skip &todo &cmp-ok
&nok &throws-like &eval-lives-ok &ok>);
plan 34;


# RT #126100
{
is $required-Test.gist, '(Test)', "successful require PACKAGE returns PACKAGE";
Expand Down Expand Up @@ -104,10 +106,11 @@ eval-lives-ok q|BEGIN require Fancy::Utilities;|, 'require works at BEGIN';
eval-lives-ok q|BEGIN require Fancy::Utilities <&allgreet>;|,'require can import at BEGIN';

{
require "S11-modules/GlobalOuter.pm";
nok ::('GlobalOuter') ~~ Failure, "got outer symbol";
ok ::('GlobalOuter').load, "call method that causes a require";
ok ::('GlobalInner') ~~ Failure, "Did not find inner symbol";
require "S11-modules/GlobalOuter.pm";
cmp-ok ::('GlobalOuter'), '!~~', Failure, "got outer symbol";
ok ::('GlobalOuter').load, "call method that causes a require";
fails-like { ::('GlobalInner') }, X::NoSuchSymbol,
"did not find inner symbol";
}

# Test that symbols under a core package namespace (Cool::) are merged.
Expand Down

0 comments on commit 6fa5f64

Please sign in to comment.