File: 02rss.t

package info (click to toggle)
libxml-rsslite-perl 0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 80 kB
  • ctags: 15
  • sloc: perl: 202; xml: 58; makefile: 43
file content (28 lines) | stat: -rw-r--r-- 727 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
27
28
use XML::RSSLite;
print "1..2\n";

if( open(RSS, "t/sampleRSS.xml") ){
  my(%result, $str);
  $str = do{ local $/; <RSS>};
  close(RSS);
  parseRSS(\%result, \$str);
  print 'not ' unless $result{image}->[1]->{width} == 176;
  print "ok 1 # $result{image}->[1]->{width} == 176\n";
}
else{
  print "ok 1 #skipped Could not open t/sampleRSS.xml:$!\n";
}

if( open(RSS, "t/journal.rss") ){
  my(%result, $str);
  $str = do{ local $/; <RSS>};
  close(RSS);
  parseRSS(\%result, \$str);
  print 'not ' unless $result{items}->[0]->{title} eq 'gizmo_mathboy (2002.05.03 13:41)';
  print "ok 2 # '$result{items}->[0]->{title}' eq 'gizmo_mathboy (2002.05.03 13:41)'\n";
}
else{
  print "ok 2 #skipped Could not open t/rss: $!\n";
}

1;