allow for platform-specific file separator
[p5sagit/lib-with-preamble.git] / t / example.t
1 use strict;
2 use warnings FATAL => 'all';
3 use if $] <= 5.010000, 'Test::More', skip_all => 'This test requires 5.10';
4 use Test::More qw(no_plan);
5 use lib::with::preamble 'use v5.10;', 't/lib';
6 use File::Spec;
7
8 ok(eval { require my_given_example; 1 }, 'Loaded module');
9
10 sub result_for { eval { my_given_example::example_sub($_[0]) } }
11
12 is(result_for(1), 'positive');
13 is(result_for(-1), 'negative');
14 is(result_for(0), 'zero');
15
16 is(my_given_example::my_file(), File::Spec->catfile(qw(t lib my_given_example.pm)));
17 is(my_given_example::my_line(), 12);