File: 00_basic.t

package info (click to toggle)
libxml-dt-perl 0.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 296 kB
  • ctags: 42
  • sloc: perl: 914; xml: 424; makefile: 64
file content (33 lines) | stat: -rw-r--r-- 738 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
29
30
31
32
33
# -*- cperl -*-

use Test::More tests => 12;
use XML::DT;
ok(1);

# normalize_space
is(XML::DT::normalize_space("  teste  "), "teste");
is(XML::DT::normalize_space("\tteste\t"), "teste");
is(XML::DT::normalize_space("\tteste  "), "teste");

is(XML::DT::normalize_space(" spaces   in   \t the middle\t"),
   "spaces in the middle");

# toxml as function
is(toxml("a",{},""), "<a></a>");
is(toxml("a",{},"c"), "<a>c</a>");
is(toxml("a",{a=>1},"c"), "<a a=\"1\">c</a>");

# this is one of the most important tests for MathML
is(toxml("foo",{},"0"), "<foo>0</foo>");

# toxml with variables
$q = "a";
$c = "b";
%v = ();
is(toxml, "<a>b</a>");

$v{foo} = "bar";
is(toxml, "<a foo=\"bar\">b</a>");

$c = '0';
is(toxml, "<a foo=\"bar\">0</a>");