From 287cc94cbafcc7da313b6a8aa00875491a85829c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 15 Nov 2019 00:56:58 -0500 Subject: [PATCH] Fix doom-load-autoloads-file tests on macos Since /var is symlinked to /private/var on macos, the tests -- which do a simple string comparison between two paths -- won't correctly determine the two paths are the same file. --- core/test/helpers.el | 2 ++ core/test/test-core.el | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/test/helpers.el b/core/test/helpers.el index a4d9986eb..618087fb4 100644 --- a/core/test/helpers.el +++ b/core/test/helpers.el @@ -13,6 +13,8 @@ ;; ;;; Buttercup extensions +(buttercup-define-matcher-for-binary-function :to-equal-file file-equal-p) + (buttercup-define-matcher :to-expand-into (form expected) (cl-destructuring-bind (form expected) (mapcar #'funcall (list form expected)) diff --git a/core/test/test-core.el b/core/test/test-core.el index 00a45acb4..a236ed5e9 100644 --- a/core/test/test-core.el +++ b/core/test/test-core.el @@ -86,12 +86,12 @@ (it "loads the byte-compiled autoloads file if available" (doom-load-autoloads-file doom-autoload-file) - (expect (caar load-history) :to-equal + (expect (caar load-history) :to-equal-file (byte-compile-dest-file doom-autoload-file)) (delete-file (byte-compile-dest-file doom-autoload-file)) (doom-load-autoloads-file doom-autoload-file) - (expect (caar load-history) :to-equal doom-autoload-file)) + (expect (caar load-history) :to-equal-file doom-autoload-file)) (it "returns non-nil if successful" (expect (doom-load-autoloads-file doom-autoload-file)))