unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
blob 39e4fe06ba9fb95aa10aacd94d4fb500846a85f0 1966 bytes (raw)
name: test/lisp/progmodes/cperl-mode-resources/here-docs.pl 	 # note: path name is non-authoritative(*)

  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__

debug log:

solving 39e4fe06ba ...
found 39e4fe06ba in https://yhetil.org/emacs-bugs/87zh24611c.fsf@hajtower/ ||
	https://yhetil.org/emacs-bugs/87sg7xxo0s.fsf@hajtower/

applying [1/1] https://yhetil.org/emacs-bugs/87zh24611c.fsf@hajtower/
diff --git a/test/lisp/progmodes/cperl-mode-resources/here-docs.pl b/test/lisp/progmodes/cperl-mode-resources/here-docs.pl
new file mode 100644
index 0000000000..39e4fe06ba

Checking patch test/lisp/progmodes/cperl-mode-resources/here-docs.pl...
Applied patch test/lisp/progmodes/cperl-mode-resources/here-docs.pl cleanly.

skipping https://yhetil.org/emacs-bugs/87sg7xxo0s.fsf@hajtower/ for 39e4fe06ba
index at:
100644 39e4fe06ba9fb95aa10aacd94d4fb500846a85f0	test/lisp/progmodes/cperl-mode-resources/here-docs.pl

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).