Lines 50-67
subtest 'Serializing and deserializing contents' => sub {
Link Here
|
50 |
} |
50 |
} |
51 |
)->store(); |
51 |
)->store(); |
52 |
|
52 |
|
53 |
my $encoded_data; |
53 |
is( $template->contents, JSON->new->encode($data), 'Contents serialized correctly' ); |
54 |
foreach my $key ( keys %{$data} ) { |
54 |
is_deeply( $template->decoded_contents, $data, 'Contents deserialized correctly' ); |
55 |
$encoded_data->{$key} = Encode::encode('UTF-8', $data->{$key}); |
|
|
56 |
} |
57 |
|
58 |
is( $template->contents, JSON->new->utf8->encode($data), 'Contents serialized correctly' ); |
59 |
|
60 |
is_deeply( |
61 |
$template->decoded_contents, |
62 |
$encoded_data, |
63 |
'Contents deserialized and UTF-8 encoded correctly' |
64 |
); |
65 |
|
55 |
|
66 |
$schema->storage->txn_rollback; |
56 |
$schema->storage->txn_rollback; |
67 |
}; |
57 |
}; |
68 |
- |
|
|