File: 40_item.t

package info (click to toggle)
libxml-rss-simplegen-perl 11.11-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 280 kB
  • sloc: perl: 1,230; makefile: 4
file content (30 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (5)
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

require 5;
use strict;
use Test;
BEGIN { plan tests => 4 }

print "# Starting ", __FILE__ , " ...\n";
ok 1;
use XML::RSS::SimpleGen;

rss_new( 'http://blar.int' );
rss_item("http://blar.int#a", "About A");
rss_item("http://blar.int#b", "About B");
rss_item("http://blar.int#c", "About C");

ok rss_item_count(), 3;

rss_item("http://blar.int#b", "About B");

my $string = rss_as_string();
my $count = 0;
while( $string =~ m/(\#\w)\b/g ) {
  print "#  Good, found \"$1\"\n";
  ++$count;
}
ok $count, 3;

print "# bye\n";
ok 1;