all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Oliver <p.d.oliver@mavit.org.uk>
To: 74245@debbugs.gnu.org
Subject: bug#74245: 30.0.92; CPerl subroutine signatures are left open when last param is $
Date: Thu, 7 Nov 2024 19:29:58 +0000 (GMT)	[thread overview]
Message-ID: <4482f3be-621d-b66b-156d-936603160020@mavit.org.uk> (raw)
In-Reply-To: <457f28cf-be1f-58e0-5a49-8690ecd4ad25@mavit.org.uk>

[-- Attachment #1: Type: text/plain, Size: 32 bytes --]

Test attached.

-- 
Peter Oliver

[-- Attachment #2: Type: text/plain, Size: 2298 bytes --]

From b388d1c69051a9f49db129254afc62d2840bcb0f Mon Sep 17 00:00:00 2001
From: Peter Oliver <git@mavit.org.uk>
Date: Thu, 7 Nov 2024 19:22:21 +0000
Subject: [PATCH] ; cperl-mode.el: Add a test for Bug#74245

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl: New test data.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-74245): Verify
that a bare \"$\" can appear at the end of a subroutine signature.
---
 .../cperl-mode-resources/cperl-bug-74245.pl      | 16 ++++++++++++++++
 test/lisp/progmodes/cperl-mode-tests.el          |  9 +++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl

diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl
new file mode 100644
index 00000000000..44d1e49bd36
--- /dev/null
+++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl
@@ -0,0 +1,16 @@
+# This resource file can be run with cperl--run-testcases from
+# cperl-tests.el and works with both perl-mode and cperl-mode.
+
+# -------- signature where last parameter is ignored: input -------
+package P {
+use v5.36;
+sub ignore ($first, $) {}
+ignore(qw(first second));
+}
+# -------- signature where last parameter is ignored: expected output -------
+package P {
+  use v5.36;
+  sub ignore ($first, $) {}
+  ignore(qw(first second));
+}
+# -------- signature where last parameter is ignored: end -------
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
index 7a6e0b3b64a..625c41cf52c 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -1590,6 +1590,15 @@ cperl-test-bug-72296
     (should (equal (nth 8 (cperl-test-ppss code "/")) 9)))
   )
 
+(ert-deftest cperl-test-bug-74245 ()
+  "Verify that a bare \"$\" can appear at the end of a subroutine signature.
+It must not be mistaken for \"$)\"."
+  (cperl--run-test-cases
+   (ert-resource-file "cperl-bug-74245.pl")
+   (while (null (eobp))
+     (cperl-indent-command)
+     (forward-line 1))))
+
 (ert-deftest test-indentation ()
   (ert-test-erts-file (ert-resource-file "cperl-indents.erts")))
 
-- 
2.47.0


  reply	other threads:[~2024-11-07 19:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 19:19 bug#74245: 30.0.92; CPerl subroutine signatures are left open when last param is $ Peter Oliver
2024-11-07 19:29 ` Peter Oliver [this message]
2024-11-08 12:12 ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4482f3be-621d-b66b-156d-936603160020@mavit.org.uk \
    --to=p.d.oliver@mavit.org.uk \
    --cc=74245@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.