summaryrefslogtreecommitdiff
path: root/test/lisp/vc/diff-mode-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/vc/diff-mode-tests.el')
-rw-r--r--test/lisp/vc/diff-mode-tests.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el
index e497ed204df..b25836405cc 100644
--- a/test/lisp/vc/diff-mode-tests.el
+++ b/test/lisp/vc/diff-mode-tests.el
@@ -22,12 +22,11 @@
;;; Code:
+(require 'ert)
+(require 'ert-x)
(require 'diff-mode)
(require 'diff)
-(defconst diff-mode-tests--datadir
- (expand-file-name "test/data/vc/diff-mode" source-directory))
-
(ert-deftest diff-mode-test-ignore-trailing-dashes ()
"Check to make sure we successfully ignore trailing -- made by
'git format-patch'. This is bug #9597"
@@ -206,9 +205,14 @@ 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:]]"
+ (ert-resource-directory))
+ :failed :passed)
(skip-unless (executable-find shell-file-name))
(skip-unless (executable-find diff-command))
- (let ((default-directory diff-mode-tests--datadir)
+ (let ((default-directory (ert-resource-directory))
(old "hello_world.c")
(new "hello_emacs.c")
(diff-buffer (get-buffer-create "*Diff*"))
@@ -244,6 +248,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,9 +272,12 @@ 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:]]"
+ (ert-resource-directory))
+ :failed :passed)
(skip-unless (executable-find shell-file-name))
(skip-unless (executable-find diff-command))
- (let ((default-directory diff-mode-tests--datadir)
+ (let ((default-directory (ert-resource-directory))
(old "hello_world_1.c")
(new "hello_emacs_1.c")
(diff-buffer (get-buffer-create "*Diff*"))