Commit | Line | Data |
ccbd73a4 |
1 | #!/usr/bin/perl -w |
ccbd73a4 |
2 | |
3 | BEGIN { |
4 | if( $ENV{PERL_CORE} ) { |
5 | chdir 't'; |
6 | @INC = ('../lib', 'lib'); |
7 | } |
8 | else { |
9 | unshift @INC, 't/lib'; |
10 | } |
11 | } |
12 | |
13 | use strict; |
14 | use warnings; |
15 | |
16 | use Test::More tests => 5; |
17 | |
18 | can_ok "main", "explain"; |
19 | |
20 | is_deeply [explain("foo")], ["foo"]; |
21 | is_deeply [explain("foo", "bar")], ["foo", "bar"]; |
22 | |
23 | # Avoid future dump formatting changes from breaking tests by just eval'ing |
24 | # the dump |
25 | is_deeply [map { eval $_ } explain([], {})], [[], {}]; |
26 | |
27 | is_deeply [map { eval $_ } explain(23, [42,91], 99)], [23, [42, 91], 99]; |