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