File Coverage

test/html/plain.htm
Criterion Covered Total %
statement 88 88 100.0
branch n/a
condition 5 10 50.0
subroutine 4 4 100.0
pod n/a
total 97 102 95.1


line stmt bran cond sub pod time code
1 1     1   9  
  1         1  
  1         182  
2            
3            
4 3     3   6 Some Plain tests for Embperl
  3         6  
5            
6 3         56  
7            
8              
9            
10              
11             Here it starts with some HTML Text

12 1     1   5  
  1     1   2  
  1         51  
  1         4  
  1         3  
  1         26  
13             All values should be undefined:
14              
15 3   50     39 $a = [+ $a || '' +]
16 3   50     18 $b = [+ $b || '' +]
17 3   50     17 $c = [+ $c || '' +]
18 3   50     18 $d = [+ $d || '' +]
19 3   50     17 $e = [+ $e || '' +]
20              
21 3         3 ARRAY @d = [+ do { my @tmp1 = @d; "@tmp1" } +] num = [+ @d +]
  3         7  
  3         15  
22 3         16 ARRAY @x = [+ do { my @tmp1 = %x; "@tmp1" } +] num = [+ @x +]
  3         6  
  3         6  
  3         13  
23 3         12 HASH %a = [+ do { my @tmp1 = %a; my @tmp11 = sort @tmp1 ; "@tmp11" } +] num = [+ keys %a +]
  3         5  
  3         6  
  3         8  
  3         14  
24 3         11 HASH %y = [+ do { my @tmp2 = %y; my @tmp21 = sort @tmp2 ; "@tmp21" } +] num = [+ keys %y +]
  3         3  
  3         7  
  3         5  
  3         11  
25 3         10  
26              
27             First of all assign a value:
28 3         7 [- $a = '(this is the value in $a)' -]
29 3         4 [- @d = (1, 2, 3) ; @x = (9, 8, 7) -]
  3         4  
  3         6  
30 3         4 [- %a = (1 => 'a', 2 => 'b', 3 => 'c') ; %y = (9 => 'x', 8 => 'y', 7 => 'z') -]
  3         7  
  3         5  
31 3         53  
  3         3  
  3         13  
  3         9  
32              
33 3         45 Now we have some 'Umlaute':
34              
35              
36 3         4 [- $b = "$a äöü" -]
37 3         4  
  3         7  
38             Now lets look what we are getting from this:
39 3         41 [+ $a +] [+ $b +]
  3         16  
40 3         10  
41 3         24 ARRAY @d = [+ "@d" +] num = [+ @d +]
42 3         11 ARRAY @x = [+ "@x" +] num = [+ @x +]
  3         15  
43 3         8 HASH %a = [+ do { my @tmp1 = %a; my @tmp11 = sort @tmp1 ; "@tmp11" } +] num = [+ keys %a +]
  3         6  
  3         9  
  3         18  
  3         17  
44 3         8 HASH %y = [+ do { my @tmp2 = %y; my @tmp21 = sort @tmp2 ; "@tmp21" } +] num = [+ keys %y +]
  3         5  
  3         7  
  3         8  
  3         19  
45 3         8  
46 3         17 And now a and b together: [+ "$a$b" +]

47              
48             Here we have some HTML tags within the perl code, Embperl will delete them!
49              
50 3         13 [+ $c =
6 + 17 * 3    + 0 +]
51 3         12 [+ "SELECT *
FROM a ORDER BY b USING <; Hi There>" +]
52              
53             Here we have something which looks like a HTML tag, but does not start with
54             a character, Embperl does not change them!
55              
56 3         9 [+ "SELECT * FROM a ORDER BY b USING <; Hi There>" +]
57              
58             Embperl will also translate HMTL escapes to the right characters i.e. $a &lt; 6 will get the perl expression $a < 6:
59              
60 3         7 [- $e = 2 # here is a perl comment -]
61 3         2 [+ $d = $e < 6 +]
  3         7  
  3         14  
62              
63 3         46 Now they should have a value
64              
65 3         9 $a = [+ $a +]
66 3         8 $b = [+ $b +]
67 3         8 $c = [+ $c +]
68 3         8 $d = [+ $d +]
69 3         9 $e = [+ $e +]
70              
71 3         16 Input Separator = [+ ord($/) +]
72              
73 3         4 [-=pod
74 3         7  
75             blabla
76              
77             =cut-]
78              
79             [-
80 3         4 =pod
81              
82             blabla
83              
84             =cut
85             -]
86              
87 3         47  
88              
89 3         6  
90            

Ok.

91 3         5903  
92              
93            
94