File: 004-vstring.t

package info (click to toggle)
libdata-printer-perl 1.002001-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 748 kB
  • sloc: perl: 4,364; makefile: 7; sh: 1
file content (22 lines) | stat: -rw-r--r-- 438 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
use Test::More;
use Data::Printer::Object;

if ($] < 5.010) {
    plan skip_all => 'Older perls do not have VSTRING support';
}
else {
    plan tests => 1;
}

my $version = v1.2.3;
my $ddp = Data::Printer::Object->new( colored => 0 );
my $res = $ddp->parse(\$version);

if ($res eq 'VSTRING object (unable to parse)' || $res eq 'v1.2.3') {
    pass 'VSTRING';
}
else {
    fail "expected v1.2.3, got '$res'!";
}