File: 02-content.t

package info (click to toggle)
libxml-atom-perl 0.09-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 288 kB
  • ctags: 223
  • sloc: perl: 2,423; xml: 235; makefile: 50
file content (55 lines) | stat: -rw-r--r-- 1,586 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# $Id: 02-content.t,v 1.3 2004/05/08 18:33:46 btrott Exp $

use strict;

use Test;
use XML::Atom::Content;

BEGIN { plan tests => 22 };

my $content;

$content = XML::Atom::Content->new;
ok($content->elem);
$content->type('image/jpeg');
ok($content->type, 'image/jpeg');
$content->type('application/gzip');
ok($content->type, 'application/gzip');

$content = XML::Atom::Content->new('This is a test.');
ok($content->body);
ok($content->body, 'This is a test.');
ok($content->mode, 'xml');

$content = XML::Atom::Content->new(Body => 'This is a test.');
ok($content->body);
ok($content->body, 'This is a test.');
ok($content->mode, 'xml');

$content = XML::Atom::Content->new(Body => 'This is a test.', Type => 'foo/bar');
ok($content->body);
ok($content->body, 'This is a test.');
ok($content->mode, 'xml');
ok($content->type, 'foo/bar');

$content = XML::Atom::Content->new;
$content->body('This is a test.');
ok($content->body, 'This is a test.');
ok($content->mode, 'xml');
$content->type('foo/bar');
ok($content->type, 'foo/bar');

$content = XML::Atom::Content->new;
$content->body('<p>This is a test with XHTML.</p>');
ok($content->body, '<p>This is a test with XHTML.</p>');
ok($content->mode, 'xml');

$content = XML::Atom::Content->new;
$content->body('<p>This is a test with invalid XHTML.');
ok($content->body, '<p>This is a test with invalid XHTML.');
ok($content->mode, 'escaped');

$content = XML::Atom::Content->new;
$content->body("This is a test that should use base64\0.");
ok($content->mode, 'base64');
ok($content->body, "This is a test that should use base64\0.");