File: 07deeply.t

package info (click to toggle)
libtest-xml-simple-perl 1.06-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 132 kB
  • sloc: perl: 158; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (7)
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
use Test::Builder::Tester tests=>2;
use Test::XML::Simple;

my $xml = <<EOS;
<CATALOG>
  <CD>
    <TITLE>Sacred Love</TITLE>
    <ARTIST>Sting</ARTIST>
    <COUNTRY>USA</COUNTRY>
    <COMPANY>A&amp;M</COMPANY>
    <PRICE>12.99</PRICE>

    <YEAR>2003</YEAR>
  </CD>
</CATALOG>
EOS

my $fragment = <<EOS;
<ARTIST>Sting</ARTIST>
EOS

test_out("ok 1 - deep match");
xml_is_deeply($xml, "//ARTIST", $fragment, "deep match");
test_test('deep match');

test_out('ok 1 - identical match');
xml_is_deeply($xml, "/", $xml, "identical match");
test_test('identical match');