emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5e77336: Mark some diff tests as failing in nonascii directories


From: Glenn Morris
Subject: master 5e77336: Mark some diff tests as failing in nonascii directories
Date: Sat, 12 Sep 2020 22:47:59 -0400 (EDT)

branch: master
commit 5e7733694e9bbf77759267b6d0386383315d48b3
Author: Glenn Morris <rgm@gnu.org>
Commit: Glenn Morris <rgm@gnu.org>

    Mark some diff tests as failing in nonascii directories
    
    * test/lisp/vc/diff-mode-tests.el (diff-mode-test-font-lock)
    (diff-mode-test-font-lock-syntax-one-line):
    Expect failure in non-ascii directories.
    
    ; * lisp/vc/diff-mode.el (diff-hunk-file-names): Comment.
---
 lisp/vc/diff-mode.el            | 6 +++++-
 test/lisp/vc/diff-mode-tests.el | 9 +++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index a1fdd11..f272db1 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -931,8 +931,12 @@ If the OLD prefix arg is passed, tell the file NAME of the 
old file."
                       (progn (diff-hunk-prev) (point))
                     (error (point-min)))))
          (header-files
-           ;; handle filenames with spaces;
+           ;; handle file names with spaces;
            ;; cf. diff-font-lock-keywords / diff-file-header
+           ;; FIXME if there are nonascii characters in the file names,
+           ;; GNU diff displays them as octal escapes.
+           ;; This function should undo that, so as to return file names
+           ;; that are usable in Emacs.
           (if (looking-at "[-*][-*][-*] \\([^\t\n]+\\).*\n[-+][-+][-+] 
\\([^\t\n]+\\)")
               (list (if old (match-string 1) (match-string 2))
                     (if old (match-string 2) (match-string 1)))
diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el
index e497ed2..f17ec36 100644
--- a/test/lisp/vc/diff-mode-tests.el
+++ b/test/lisp/vc/diff-mode-tests.el
@@ -206,6 +206,11 @@ youthfulness
 
 (ert-deftest diff-mode-test-font-lock ()
   "Check font-locking of diff hunks."
+  ;; See comments in diff-hunk-file-names about nonascii.
+  ;; In such cases, the diff-font-lock-syntax portion of this fails.
+  :expected-result (if (string-match-p "[[:nonascii:]]"
+                                       diff-mode-tests--datadir)
+                       :failed :passed)
   (skip-unless (executable-find shell-file-name))
   (skip-unless (executable-find diff-command))
   (let ((default-directory diff-mode-tests--datadir)
@@ -244,6 +249,7 @@ youthfulness
                  111 124 (face diff-context)
                  124 127 (face diff-context))))
 
+      ;; Test diff-font-lock-syntax.
       (should (equal (mapcar (lambda (o)
                                (list (- (overlay-start o) diff-beg)
                                      (- (overlay-end o) diff-beg)
@@ -267,6 +273,9 @@ youthfulness
 
 (ert-deftest diff-mode-test-font-lock-syntax-one-line ()
   "Check diff syntax highlighting for one line with no newline at end."
+  :expected-result (if (string-match-p "[[:nonascii:]]"
+                                       diff-mode-tests--datadir)
+                       :failed :passed)
   (skip-unless (executable-find shell-file-name))
   (skip-unless (executable-find diff-command))
   (let ((default-directory diff-mode-tests--datadir)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]