bug#81475: 31.0.91; cperl-test-* failures on 32-bit Solaris sparc

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
> From: Harald Jörg <[email protected]>
> Cc: [email protected],  [email protected]
> Date: Sun, 26 Jul 2026 12:17:09 +0000
> 
> Eli Zaretskii <[email protected]> writes:
> 
> > [...]
> >> cperl-mode-tests.el itself has unicode characters in other tests, but
> >> apparently these pass.  I guess this is because file-coding-system-alist
> >> has "prefer-utf-8" for .el files.
> >
> > Yes, *.el files should not be a problem.
> >
> >> So chances are that we don't need to skip the tests at all if we
> >> wrap the tests in a block like this:
> >> 
> >> (let ((coding-system-for-read 'utf-8))
> >>   ;; read resource file and run tests
> >>   )
> >> 
> >> Ok if I commit this?
> >
> > Maybe post the patch first so Paul could try it on that system?
> > Unless you have access to a similar system, that is.
> 
> Yes, that's better.  I have no access to Solaris machines.
> Here you are!

Thanks.  Paul, could you please try these patches and see if they fix
the problems with those tests?

> >From 671623831df803f72572f95711a4282c79943e29 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Harald=20J=C3=B6rg?= <[email protected]>
> Date: Sun, 26 Jul 2026 14:10:00 +0200
> Subject: [PATCH] ; cperl-mode-tests.el: read resource files as UTF-8
> 
> * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-imenu-index),
> (cperl-test-extra-delimiters): Enforce utf8 when reading resource files.
> ---
>  test/lisp/progmodes/cperl-mode-tests.el | 110 ++++++++++++------------
>  1 file changed, 56 insertions(+), 54 deletions(-)
> 
> diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
> index 117eb9fdf9a..b69a7931540 100644
> --- a/test/lisp/progmodes/cperl-mode-tests.el
> +++ b/test/lisp/progmodes/cperl-mode-tests.el
> @@ -919,33 +919,34 @@ cperl-test-extra-delimiters
>  have extra paired delimiters."
>    (skip-unless (eq cperl-test-mode #'cperl-mode))
>    (with-temp-buffer
> -    (insert-file-contents (ert-resource-file "extra-delimiters.pl"))
> -    (funcall cperl-test-mode)
> -    (cperl-extra-paired-delimiters-mode t)
> -    (font-lock-ensure)
> -    (goto-char (point-min))
> -    (search-forward-regexp "\\(label:\\)")
> -    (should (equal (get-text-property (match-beginning 1) 'face)
> -                   'font-lock-constant-face))
> -    (search-forward-regexp "\\(comment\\)")
> -    (should (equal (get-text-property (match-beginning 1) 'face)
> -                   'font-lock-comment-face))
> -    (search-forward-regexp "\\(sanity\\)")
> -    (should (equal (get-text-property (match-beginning 1) 'face)
> -                   'font-lock-variable-name-face))
> -    ;; Now switch off the minor mode and redo
> -    (cperl-extra-paired-delimiters-mode -1)
> -    (font-lock-ensure)
> -    (goto-char (point-min))
> -    (search-forward-regexp "\\(label:\\)")
> -    (should (equal (get-text-property (match-beginning 1) 'face)
> -                   'font-lock-string-face))
> -    (search-forward-regexp "\\(comment\\)")
> -    (should (equal (get-text-property (match-beginning 1) 'face)
> -                   'font-lock-string-face))
> -    (search-forward-regexp "\\(sanity\\)")
> -    (should (equal (get-text-property (match-beginning 1) 'face)
> -                   'font-lock-variable-name-face))))
> +    (let ((coding-system-for-read 'utf-8))
> +      (insert-file-contents (ert-resource-file "extra-delimiters.pl"))
> +      (funcall cperl-test-mode)
> +      (cperl-extra-paired-delimiters-mode t)
> +      (font-lock-ensure)
> +      (goto-char (point-min))
> +      (search-forward-regexp "\\(label:\\)")
> +      (should (equal (get-text-property (match-beginning 1) 'face)
> +                     'font-lock-constant-face))
> +      (search-forward-regexp "\\(comment\\)")
> +      (should (equal (get-text-property (match-beginning 1) 'face)
> +                     'font-lock-comment-face))
> +      (search-forward-regexp "\\(sanity\\)")
> +      (should (equal (get-text-property (match-beginning 1) 'face)
> +                     'font-lock-variable-name-face))
> +      ;; Now switch off the minor mode and redo
> +      (cperl-extra-paired-delimiters-mode -1)
> +      (font-lock-ensure)
> +      (goto-char (point-min))
> +      (search-forward-regexp "\\(label:\\)")
> +      (should (equal (get-text-property (match-beginning 1) 'face)
> +                     'font-lock-string-face))
> +      (search-forward-regexp "\\(comment\\)")
> +      (should (equal (get-text-property (match-beginning 1) 'face)
> +                     'font-lock-string-face))
> +      (search-forward-regexp "\\(sanity\\)")
> +      (should (equal (get-text-property (match-beginning 1) 'face)
> +                     'font-lock-variable-name-face)))))
>  
>  
>  ;;; Function test: Building an index for imenu
> @@ -956,33 +957,34 @@ cperl-test-imenu-index
>  created by CPerl mode, so skip it for Perl mode."
>    (skip-unless (eq cperl-test-mode #'cperl-mode))
>    (with-temp-buffer
> -    (insert-file-contents (ert-resource-file "grammar.pl"))
> -    (cperl-mode)
> -    (let ((index (cperl-imenu--create-perl-index))
> -          current-list)
> -      (setq current-list (assoc-string "+Unsorted List+..." index))
> -      (should current-list)
> -      (let ((expected '("(main)::outside"
> -                        "Package::in_package"
> -                        "Shoved::elsewhere"
> -                        "Package::prototyped"
> -                        "Versioned::Package::versioned"
> -                        "Block::attr"
> -                        "Versioned::Package::outer"
> -                        "lexical"
> -                        "Versioned::Block::signatured"
> -                        "Package::in_package_again"
> -                        "Erdős::Number::erdős_number"
> -                        "Class::Class::init"
> -                        "Class::Inner::init_again"
> -                        "With::Accessors->auto_reader"
> -                        "With::Accessors->named"
> -                        "With::Accessors->set_auto_writer"
> -                        "With::Accessors->read_all"
> -                        "With::Accessors->set_auto_all")))
> -        (dolist (sub expected)
> -          (should (assoc-string sub index))))
> -      (should-not (assoc-string "_false" index)))))
> +    (let ((coding-system-for-read 'utf-8))
> +      (insert-file-contents (ert-resource-file "grammar.pl"))
> +      (cperl-mode)
> +      (let ((index (cperl-imenu--create-perl-index))
> +            current-list)
> +        (setq current-list (assoc-string "+Unsorted List+..." index))
> +        (should current-list)
> +        (let ((expected '("(main)::outside"
> +                          "Package::in_package"
> +                          "Shoved::elsewhere"
> +                          "Package::prototyped"
> +                          "Versioned::Package::versioned"
> +                          "Block::attr"
> +                          "Versioned::Package::outer"
> +                          "lexical"
> +                          "Versioned::Block::signatured"
> +                          "Package::in_package_again"
> +                          "Erdős::Number::erdős_number"
> +                          "Class::Class::init"
> +                          "Class::Inner::init_again"
> +                          "With::Accessors->auto_reader"
> +                          "With::Accessors->named"
> +                          "With::Accessors->set_auto_writer"
> +                          "With::Accessors->read_all"
> +                          "With::Accessors->set_auto_all")))
> +          (dolist (sub expected)
> +            (should (assoc-string sub index))))
> +        (should-not (assoc-string "_false" index))))))
>  
>  ;;; Tests for issues reported in the Bug Tracker
>  
> -- 
> 2.43.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.