Skip to content

Commit

Permalink
basic tests for require
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 24, 2010
1 parent ef86bef commit e9774db
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions S11-modules/require.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use v6;
use Test;

plan 3;

# no need to do that compile time, sine require() really is run time
@*INC.push: 't/spec/packages';

lives_ok { require Fancy::Utilities; CATCH { diag $! } },
'can load Fancy::Utilities at run time';
is Fancy::Utilities::lolgreet('me'),
'O HAI ME', 'can call our-sub from required module';

lives_ok { my $name = 'A'; require $name }, 'can require with variable name';

# vim: ft=perl6

0 comments on commit e9774db

Please sign in to comment.