all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Fabrice Popineau <fabrice.popineau@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Regex PCRE tests failure under windows
Date: Thu, 3 Aug 2017 12:28:59 +0200	[thread overview]
Message-ID: <CAFgFV9OkBxSM+v=qO4eua7=X6XXQYNFAPMU92OJo9K7K8TDvGg@mail.gmail.com> (raw)

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

I have this test failure on PCRE regex tests (emacs-master, mingw64) :

$ cat test/src/regex-tests.log
Running 22 tests (2017-08-01 22:21:34+0200)
   passed   1/22  regex-tests-BOOST
Test regex-tests-PCRE backtrace:
Test regex-tests-PCRE condition:
    (wrong-type-argument stringp nil)
   FAILED   2/22  regex-tests-PCRE


The failure occurs here in PCRE.tests :

    caterpillar caterpillar23
 0: caterpillar caterpillar23
 1: caterpillar
 2: erpillar
 3: <unset>
 4:
 5: 3

The variable which is nil instead of being a string is `pattern'
in (if (string-match pattern string) nil 'search-failed)`' :

(defun regex-tests-PCRE ()
  (let (failures
        pattern icase string what-failed matches-observed)
    (regex-tests-generic-line
     ?# "PCRE.tests" regex-tests-PCRE-whitelist

     (cond

      ;; pattern
      ((save-excursion (re-search-forward "^/\\(.*\\)/\\(.*i?\\)$" nil t))
       (setq icase (string= "i" (match-string 2))
             pattern (regex-tests-unextend (match-string 1))))

      ;; string. read it in, match against pattern, and save all the results
      ((save-excursion (re-search-forward "^    \\(.*\\)" nil t))
       (let ((case-fold-search icase))
         (setq string (match-string 1)

               ;; the regex match under test
               what-failed
               (condition-case nil
                   (if (string-match pattern string) nil 'search-failed)
                 ('invalid-regexp 'compilation-failed))

               matches-observed
               (cl-loop for x from 0 to 20
                        collect (and (not what-failed)
                                     (or (match-string x string)
"<unset>")))))
       nil)

But I have no idea why pattern is losing its value ?

Any clue ?

Regards,

Fabrice

[-- Attachment #2: Type: text/html, Size: 2771 bytes --]

             reply	other threads:[~2017-08-03 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 10:28 Fabrice Popineau [this message]
2017-08-03 11:52 ` Regex PCRE tests failure under windows Fabrice Popineau

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='CAFgFV9OkBxSM+v=qO4eua7=X6XXQYNFAPMU92OJo9K7K8TDvGg@mail.gmail.com' \
    --to=fabrice.popineau@gmail.com \
    --cc=emacs-devel@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.