summaryrefslogtreecommitdiff
path: root/t/tests/page.t
blob: 62faf9817a3f47b8173f14bbc687e7a4f7d2d8fe (plain)
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
# -*- mode: perl6 -*- 
use Test;
use lib 't/lib';
use Test::WebCoso;
use File::Temp;
use WebCoso;
 
my $testdir = tempdir.IO;
my $srcdir = $testdir.child('src');
my $destdir = $testdir.child('dst');
 
$srcdir.mkdir;
$destdir.mkdir;
 
$srcdir.child('document.it.tt').spurt('it');
$srcdir.child('document.en.rest.txt').spurt('en');
$srcdir.child('du2xhtml.xsl').spurt('<>');
 
my $wc = WebCoso.new(:$srcdir,:$destdir);
$wc.new-page('');
$wc.run();
 
my %output = $wc.get-files('','document','html');
dd %output;
 
cmp-files(
    %output,
    {
        it => { $^x.contents eq 'it expanded parsed converted (<>) decorated' },
        en => { $^x.contents eq 'en parsed converted (<>) decorated' },
    },
    'built everyting',
);
 
$wc.get-file('','du2xhtml.xsl').contents('<new>');
 
%output = $wc.get-files('','document','html');
dd %output;
dd %output<it>.contents;
dd %output<en>.contents;
 
cmp-files(
    %output,
    {
        it => { $^x.contents eq 'it expanded parsed converted (<new>) decorated' },
        en => { $^x.contents eq 'en parsed converted (<new>) decorated' },
    },
    're-built everyting',
);
 
done-testing;