probably make the test not die
[p5sagit/lib-with-preamble.git] / t / example.t
CommitLineData
dcd0209b 1use strict;
2use warnings FATAL => 'all';
201ca098 3use if $] <= 5.010000, 'Test::More', skip_all => 'This test requires 5.10';
dcd0209b 4use Test::More qw(no_plan);
5use lib::with::preamble 'use v5.10;', 't/lib';
6
7ok(eval { require my_given_example; 1 }, 'Loaded module');
8
9sub result_for { eval { my_given_example::example_sub($_[0]) } }
10
11is(result_for(1), 'positive');
12is(result_for(-1), 'negative');
13is(result_for(0), 'zero');
14
15is(my_given_example::my_file(), 't/lib/my_given_example.pm');
16is(my_given_example::my_line(), 12);