emacs/test/lisp/progmodes/cperl-mode-resources/cperl-bug-35925.pl
Mauro Aranda 7caa3f5499 Fix indentation in perl-mode (Bug#35925)
* lisp/progmodes/perl-mode.el (perl--format-regexp): New defconst.
(perl--end-of-format-p): New function.
(perl-continuation-line-p): Use it.
(perl-calculate-indent): Use it.  Make the lines of the formlist stay
at column 0.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-35925.pl: New
test file.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-35925): New
test.
2023-10-01 04:13:17 +02:00

36 lines
614 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.
# -------- Bug#35925: input -------
format FH =
@### @.### @###
42, 3.1415, 0
.
write FH;
# -------- Bug#35925: expected output -------
format FH =
@### @.### @###
42, 3.1415, 0
.
write FH;
# -------- Bug#35925: end -------
# -------- format not as top-level: input -------
foo: {
format STDOUT =
^<<<<
$foo
.
write;
}
# -------- format not as top-level: expected output -------
foo: {
format STDOUT =
^<<<<
$foo
.
write;
}
# -------- format not as top-level: end -------