File: copy_fail.t

package info (click to toggle)
libxml-smart-perl 1.78-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 784 kB
  • sloc: perl: 3,644; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 706 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!perl -T
use 5.006                   ;
use strict                  ;
use warnings FATAL => 'all' ;
use Test::More              ;

use XML::Smart              ;  


my @xml = <DATA>            ;
my $xml = join( '', @xml )  ;

subtest 'Copy' => sub {

    my $xml_ob      = XML::Smart->new( $xml ) ;
    my $xml_ob_copy = $xml_ob->copy() ;

    cmp_ok( $xml_ob->nodes_keys, 'eq', $xml_ob_copy->nodes_keys, 'Basic Copy Test' );

    $xml_ob = $xml_ob->{ test };
    $xml_ob_copy = $xml_ob->copy() ;

    cmp_ok( $xml_ob->nodes_keys, 'eq', $xml_ob_copy->nodes_keys, 'Stepped Copy Test' );

    done_testing() ;

};

done_testing() ;


__DATA__
<test>
   <entry name="test1"/>
   <entry name="test2"/>
</test>