emacs/test/lisp/progmodes/cperl-mode-resources/cperl-bug-11733.pl
Harald Jörg 9b9dcc146b ; cperl-mode.el: Fix two indentation bugs (Bug#11733)
* lisp/progmodes/cperl-mode.el (cperl-sniff-for-indent): Detect
whether we have a label or a regex/string.
(cperl-calculate-indent): Check for things which look like labels
but aren't.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-11733):
Test the examples provided in the bug report.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-11733.pl:
Examples from the bug report.
2023-07-02 00:37:10 +02:00

50 lines
788 B
Perl

# This resource file can be run with cperl--run-testcases from
# cperl-tests.el and works with both perl-mode and cperl-mode.
# -------- Multiline declaration: input -------
#!/usr/bin/env perl
# -*- mode: cperl -*-
sub foo
{
}
sub bar
{
}
# -------- Multiline declaration: expected output -------
#!/usr/bin/env perl
# -*- mode: cperl -*-
sub foo
{
}
sub bar
{
}
# -------- Multiline declaration: end -------
# -------- Fred Colon at work: input --------
#!/usr/bin/env perl
# -*- mode: cperl -*-
while (<>)
{
m:^ \d+ p:
or die;
m:^ \d+ :
or die;
}
# -------- Fred Colon at work: expected output --------
#!/usr/bin/env perl
# -*- mode: cperl -*-
while (<>)
{
m:^ \d+ p:
or die;
m:^ \d+ :
or die;
}
# -------- Fred Colon at work: end --------