GNU bug report logs - #24071
[PATCH] Refactor regex character class parsing in [:name:]

Previous Next

Package: emacs;

Reported by: Michal Nazarewicz <mina86 <at> mina86.com>

Date: Mon, 25 Jul 2016 22:55:02 UTC

Severity: wishlist

Tags: patch

Done: Michal Nazarewicz <mina86 <at> mina86.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michal Nazarewicz <mina86 <at> mina86.com>
To: 24071 <at> debbugs.gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#24071: [PATCH 3/7] Fix reading of regex-resources in regex-tests
Date: Wed, 27 Jul 2016 18:50:43 +0200
* test/src/regex-tests.el (regex-tests-generic-line): Referring to
‘buffer-file-name’ does not work when running the test from command
line, i.e. via make, which results in (wrong-type-argument stringp nil)
failures.  Replace it with hard-coded path.
(regex-tests-BOOST, regex-tests-PCRE, regex-tests-PTESTS-whitelist,
regex-tests-TESTS-whitelist): ‘regex-tests-generic-line’ now  includes
the ‘regex-resources’ path component so the tests don’t need to specify
it explicitly.
---
 test/src/regex-tests.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/test/src/regex-tests.el b/test/src/regex-tests.el
index 13a9f86..1407441 100644
--- a/test/src/regex-tests.el
+++ b/test/src/regex-tests.el
@@ -99,8 +99,7 @@ regex-tests-generic-line
 
   `(with-temp-buffer
     (modify-syntax-entry ?_ "w;; ") ; tests expect _ to be a word
-    (insert-file-contents ,(concat (file-name-directory (buffer-file-name)) test-file))
-
+    (insert-file-contents ,(concat "src/regex-resources/" test-file))
     (let ((case-fold-search nil)
           (line-number 1)
           (whitelist-idx 0))
@@ -419,7 +418,7 @@ regex-tests-BOOST
   (let (failures
         basic icase newline notbol noteol)
     (regex-tests-generic-line
-     ?; "regex-resources/BOOST.tests" regex-tests-BOOST-whitelist
+     ?; "BOOST.tests" regex-tests-BOOST-whitelist
      (if (save-excursion (re-search-forward "^-" nil t))
          (setq basic   (save-excursion (re-search-forward "REG_BASIC" nil t))
                icase   (save-excursion (re-search-forward "REG_ICASE" nil t))
@@ -496,7 +495,7 @@ regex-tests-PCRE
   (let (failures
         pattern icase string what-failed matches-observed)
     (regex-tests-generic-line
-     ?# "regex-resources/PCRE.tests" regex-tests-PCRE-whitelist
+     ?# "PCRE.tests" regex-tests-PCRE-whitelist
 
      (cond
 
@@ -570,7 +569,7 @@ regex-tests-PTESTS-whitelist
 (defun regex-tests-PTESTS ()
   (let (failures)
     (regex-tests-generic-line
-     ?# "regex-resources/PTESTS" regex-tests-PTESTS-whitelist
+     ?# "PTESTS" regex-tests-PTESTS-whitelist
      (let* ((fields (split-string (buffer-string) "¦"))
 
             ;; string has 1-based index of first char in the
@@ -632,7 +631,7 @@ regex-tests-TESTS-whitelist
 (defun regex-tests-TESTS ()
   (let (failures)
     (regex-tests-generic-line
-     ?# "regex-resources/TESTS" regex-tests-TESTS-whitelist
+     ?# "TESTS" regex-tests-TESTS-whitelist
      (if (save-excursion (re-search-forward "^\\([^:]+\\):\\(.*\\):\\([^:]*\\)$" nil t))
          (let* ((what-failed
                  (let ((raw (string-to-number (match-string 1))))
-- 
2.8.0.rc3.226.g39d4020





This bug report was last modified 8 years and 350 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.