~ubuntu-branches/ubuntu/utopic/libxml-bare-perl/utopic-proposed

« back to all changes in this revision

Viewing changes to t/Basic.t

  • Committer: Package Import Robot
  • Author(s): Nuno Carvalho, gregor herrmann, Salvatore Bonaccorso, Axel Beckert, Nuno Carvalho
  • Date: 2013-09-17 15:54:28 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130917155428-4d0xb5cissw2323f
Tags: 0.53-1
* Team upload.

[ gregor herrmann ]
* debian/control: update {versioned,alternative} (build) dependencies.

[ Salvatore Bonaccorso ]
* Change Vcs-Git to canonical URI (git://anonscm.debian.org)
* Change search.cpan.org based URIs to metacpan.org based URIs

[ Axel Beckert ]
* debian/copyright: migrate pre-1.0 format to 1.0 using "cme fix dpkg-
  copyright"

[ Nuno Carvalho ]
* New upstream release.
* debian/copyright: update copyright years.
* debian/control: update standards version.
* debian/control: update debhelper required version, in order to pass all
  the hardening flags to EUMM.
* Add lintian override to apparently false-positive warning.
* Add set of patches accepted upstream but still not included in this
  release, visit https://rt.cpan.org/Public/Bug/Display.html?id=88155
  for details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl -w
2
2
 
3
3
use strict;
4
 
use Test::More;
 
4
 
 
5
use Test::More qw(no_plan);
5
6
 
6
7
use_ok( 'XML::Bare', qw/xmlin/ );
7
8
 
25
26
is( $root->{xml}->{node}->{att}->{value}, '12', 'reading of " surrounded attribute value' );
26
27
is( $simple->{node}{att}, '12', 'simple - reading of " surrounded attribute value' );
27
28
 
 
29
( $xml, $root, $simple ) = reparse( "<xml><node att>val</node></xml>" );
 
30
is( $root->{xml}{node}{att}{value}, '1', "reading of value of standalone attribute" );
 
31
is( $simple->{node}{att}, '1', "simple - reading of value of standalone attribute" );
 
32
    
28
33
( $xml, $root, $simple ) = reparse( "<xml><node><![CDATA[<cval>]]></node></xml>" );
29
34
is( $root->{xml}->{node}->{value}, '<cval>', 'reading of cdata' );
30
35
is( $simple->{node}, '<cval>', 'simple - reading of cdata' );
31
36
 
32
 
( $xml, $root, $simple ) = reparse( "<xml><node att=\"12\"><![CDATA[<cval>]]></node></xml>" );
33
 
is( $root->{xml}->{node}->{value}, '<cval>', 'reading of cdata' );
34
 
is( $simple->{node}->{content}, '<cval>', 'simple - reading of cdata' );
35
 
 
36
37
( $xml, $root, $simple ) = reparse( "<xml><node>a</node><node>b</node></xml>" );
37
38
is( $root->{xml}->{node}->[1]->{value}, 'b', 'multiple node array creation' );
38
39
is( $simple->{node}[1], 'b', 'simple - multiple node array creation' );
67
68
( $xml, $root ) = new XML::Bare( text => $text );
68
69
my $i = $root->{'xml'}{'node'}{'_i'}-1;
69
70
my $z = $root->{'xml'}{'node'}{'_z'}-$i+1;
70
 
is( substr( $text, $i, $z ), '<node>checkval</node>', '_i and _z vals' );
 
71
#is( substr( $text, $i, $z ), '<node>checkval</node>', '_i and _z vals' );
71
72
 
72
73
# saving test
73
 
( $xml, $root ) = new XML::Bare( file => 't/test.xml' );
 
74
( $xml, $root ) = XML::Bare->new( file => 't/test.xml' );
74
75
$xml->save();
75
76
 
76
77
sub reparse {
94
95
 
95
96
# test bad closing tags
96
97
# we need to a way to ensure that something dies... ?
97
 
 
98
 
done_testing;