11 use_ok('Parse::Binary::Nested');
21 my $testdata = "\2foo\0!\0.rest";
24 {message => 'foo', period => '!'},
25 {message => '', period => '.'},
30 my $parser = Parse::Binary::Nested->new(\@example);
31 ok($parser, 'new object');
32 is_deeply($parser->unpackf($testdata), $testresult, 'object unpackf');
34 Parse::Binary::Nested->import('unpackf');
36 unpackf(\@example, $testdata),
41 my @commonargs = ('cxaXv', "\1\2hi\0");
43 [ values %{ unpackf(@commonargs) } ],
44 [[ unpack($commonargs[0], $commonargs[1]) ]],
45 'unpack compatibility'
49 unpackf([ lstr => 'C/a3', rest => 'a*' ], "\2quux"),
50 { lstr => 'qu', rest => 'x' },
55 unpackf([ ignoreme => 'x2X', value => 'xC' ], "\0\1\2"),