File: pandoc-metadata.t

package info (click to toggle)
libpandoc-elements-perl 0.38-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 732 kB
  • sloc: perl: 1,630; makefile: 15; sh: 1
file content (22 lines) | stat: -rw-r--r-- 715 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 Test::More;
use Pandoc::Elements;
use JSON;

is_deeply metadata 'foo', MetaString 'foo';
is_deeply metadata undef, MetaString '';
is_deeply metadata JSON::true(), MetaBool 1;
is_deeply metadata JSON::false(), MetaBool 0;
is_deeply metadata ['foo'], MetaList [ MetaString 'foo' ];
is_deeply metadata { x => [1] }, MetaMap { x => MetaList [ MetaString '1' ] };

is_deeply metadata MetaString 'foo', MetaString 'foo';
is_deeply metadata Str 'ä', MetaInlines [ Str 'ä' ];
is_deeply metadata Para [ Str 'ä' ], MetaBlocks [ Para [ Str 'ä' ] ];

my $ref = \''; 
is_deeply metadata $ref, MetaString "$ref";
$ref = bless {}, 'Pandoc::Elements';
is_deeply metadata $ref, MetaString "$ref";

done_testing;