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