File: 030_Attributes_AndQuot.t

package info (click to toggle)
libpetal-perl 2.23-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,088 kB
  • ctags: 162
  • sloc: perl: 4,738; xml: 726; makefile: 2
file content (88 lines) | stat: -rw-r--r-- 1,390 bytes parent folder | download | duplicates (9)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/perl
use warnings;
use strict;
use lib ('lib');
use Test::More 'no_plan';
use Petal;


$Petal::DISK_CACHE = 0;
$Petal::MEMORY_CACHE = 0;
$Petal::TAINT = 1;
$Petal::BASE_DIR = './t/data';

my $template;
my $string;


#####

=cut

{
    $Petal::OUTPUT = "XML";
    $template = new Petal ('attributes_andquot.xml');
    
    $string = ${$template->_canonicalize()};
    unlike($string, '/""/');
}


{
    $Petal::OUTPUT = "XHTML";
    $template = new Petal ('attributes_andquot.xml');
    
    $string = ${$template->_canonicalize()};
    unlike($string, '/""/');
}

=cut

{
    $Petal::OUTPUT = "XML";
    $template = new Petal ('inline_vars.xml');
    $string = ${$template->_canonicalize()};
    
    like($string, '/"/');
    
    like($string, '/\<\?/');
    
    like($string, '/\?\>/');
}

exit;

{
    $Petal::OUTPUT = "XHTML";
    $template = new Petal ('inline_vars.xml');
    $string = ${$template->_canonicalize()};

    like($string, '/&quot;/');
    
    like($string, '/<\?/');
    
    like($string, '/\?>/');
}


JUMP:
{
    $Petal::OUTPUT = "XML";
    $template = new Petal ('manipulate.html');
    
    $string = $template->process (
	configuration => { get_identity_field_name => 'id' }
       );

    like($string, '/petal:attributes="value entry\/id;"/');
    
    like($string, '/type="hidden"/');
    
    like($string, '/name="id"/');
}


1;


__END__