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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
| | use 5.020;
=head1 NAME
here-docs.pl - resource file for cperl-test-here-docs
=head1 DESCRIPTION
This file holds a couple of HERE documents, with a variety of normal
and edge cases. For a formatted view of this description, run:
(cperl-perldoc "here-docs.pl")
For each of the HERE documents, the following checks will done:
=over 4
=item *
All occurrences of the string "look-here" are fontified as
'font-lock-string-face. Note that we deliberately test the face, not
the syntax property: Users won't care for the syntax property, but
they see the face. Different implementations with different syntax
properties have been seen in the past.
=item *
Indentation of the line(s) containing "look-here" is 0, i.e. there are no
leading spaces.
=item *
Indentation of the following perl statement containing "indent" should
be 0 if the statement contains "noindent", and according to the mode's
continued-statement-offset otherwise.
=back
=cut
# Prologue to make the test file valid without warnings
my $text;
my $any;
my $indentation;
my $anywhere = 'back again';
=head1 The Tests
=head2 Test Case 1
We have two HERE documents in one line with different quoting styles.
=cut
## test case
$text = <<"HERE" . <<'THERE' . $any;
#look-here and
HERE
$tlook-here and
THERE
my $noindent = "This should be left-justified";
=head2 Test case 2
A HERE document followed by a continuation line
=cut
## test case
$text = <<HERE
look-here
HERE
. 'indent-level'; # Continuation, should be indented
=head2 Test case 3
A here document with a line-end comment in the starter line,
after a complete statement
=cut
## test case
$text = <<HERE; # start here
look-here
HERE
my $noindent = "New statement in this line";
=head2 Test case 4
A HERE document with a to-be-continued statement and a comment in the
starter line.
=cut
## test case
$text = <<HERE # start here
look-here
HERE
. 'indent-level'; # Continuation, should be indented
__END__
|