lib::with::preamble initial import
[p5sagit/lib-with-preamble.git] / t / example.t
CommitLineData
dcd0209b 1use strict;
2use warnings FATAL => 'all';
3use Test::More qw(no_plan);
4use lib::with::preamble 'use v5.10;', 't/lib';
5
6ok(eval { require my_given_example; 1 }, 'Loaded module');
7
8sub result_for { eval { my_given_example::example_sub($_[0]) } }
9
10is(result_for(1), 'positive');
11is(result_for(-1), 'negative');
12is(result_for(0), 'zero');
13
14is(my_given_example::my_file(), 't/lib/my_given_example.pm');
15is(my_given_example::my_line(), 12);