release 0.42
[Data-Peek.git] / t / 21_DDisplay.t
blob208b20bb5905e0d72f9a75f3f6ab48fb35a44ecb
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
6 use Test::More tests => 10;
7 use Test::NoWarnings;
9 use Data::Peek;
11 is (DDisplay (undef), '', 'undef has no PV');
12 is (DDisplay (0), '', '0 has no PV');
13 is (DDisplay (\undef), '', '\undef has no PV');
14 is (DDisplay (\0), '', '\0 has no PV');
15 is (DDisplay (sub {}), '', 'code has no PV');
17 is (DDisplay (""), '""', 'empty string');
18 is (DDisplay ("a"), '"a"', '"a"');
19 is (DDisplay ("\n"), '"\n"', '"\n"');
20 if ($] < 5.008) {
21 is (DDisplay ("\x{20ac}"), '"\342\202\254"', '"\n"');
23 else {
24 is (DDisplay ("\x{20ac}"), '"\x{20ac}"', '"\n"');