File: 06bool_deserializeRT45024.t

package info (click to toggle)
libphp-serialization-perl 0.34-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 152 kB
  • sloc: perl: 387; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 368 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
#!/usr/bin/env perl
use strict;
use warnings;

use PHP::Serialization;
use Test::More tests => 2;

my $s = 'b:0;';
my $u = PHP::Serialization::unserialize($s);
is($u, undef, 'b:0 equals undef');

$s = 'a:4:{i:0;s:3:"ABC";i:1;s:3:"OPQ";i:2;s:3:"XYZ";i:3;b:0;}';
$u = PHP::Serialization::unserialize($s);

is_deeply $u, [
    'ABC',
    'OPQ',
    'XYZ',
    undef,
];