File: 03-h2x-oop.t

package info (click to toggle)
libxml-hash-xs-perl 0.64-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 736 kB
  • sloc: ansic: 5,177; perl: 322; xml: 15; makefile: 9
file content (26 lines) | stat: -rw-r--r-- 505 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

use strict;
use warnings;

use Test::More tests => 2;

use XML::Hash::XS qw();

our $conv = XML::Hash::XS->new();
our $xml_decl = qq{<?xml version="1.0" encoding="utf-8"?>};

{
    is
        $conv->hash2xml( { node1 => sub { 'value1' } } ),
        qq{$xml_decl\n<root><node1>value1</node1></root>},
        'code reference',
    ;
}

{
    is
        XML::Hash::XS::hash2xml( { node1 => sub { 'value1' } } ),
        qq{$xml_decl\n<root><node1>value1</node1></root>},
        'code reference',
    ;
}