File: 06_mkdtskel.t

package info (click to toggle)
libxml-dt-perl 0.69-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 388 kB
  • sloc: perl: 1,432; xml: 438; makefile: 16
file content (45 lines) | stat: -rw-r--r-- 735 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#-*- cperl -*-

use Test::More tests => 2;
use XML::DT;

{
  open TMP, ">_${$}_" or die "Cannot create temporary file\n";
  select TMP;
  mkdtskel("t/05_input.xml");
  close TMP;

  open A, "_${$}_";
  open B, "t/06_output.pl";
  my $ok = 1;
  while(defined($a = <A>) && defined($b = <B>)) {
    $ok = 0 unless $a eq $b;
  }
  close B;
  close A;

  ok($ok);

  unlink "_${$}_";
}

###-----------------
{
  open TMP, ">_${$}_" or die "Cannot create temporary file\n";
  select TMP;
  mkdtskel_fromDTD("t/06_input.dtd");
  close TMP;

  open A, "_${$}_";
  open B, "t/06_dtdout.pl";
  my $ok = 1;
  while(defined($a = <A>) && defined($b = <B>)) {
    $ok = 0 unless $a eq $b;
  }
  close B;
  close A;

  ok($ok);

  unlink "_${$}_";
}