summaryrefslogtreecommitdiff
path: root/test/lisp/xdg-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/xdg-tests.el')
-rw-r--r--test/lisp/xdg-tests.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/lisp/xdg-tests.el b/test/lisp/xdg-tests.el
index 65084926203..1b678a0abbf 100644
--- a/test/lisp/xdg-tests.el
+++ b/test/lisp/xdg-tests.el
@@ -2,8 +2,8 @@
;; Copyright (C) 2017-2019 Free Software Foundation, Inc.
-;; Maintainer: emacs-devel@gnu.org
;; Author: Mark Oteiza <mvoteiza@udel.edu>
+;; Maintainer: emacs-devel@gnu.org
;; This file is part of GNU Emacs.
@@ -65,4 +65,16 @@
(should (equal (xdg-desktop-strings " ") nil))
(should (equal (xdg-desktop-strings "a; ;") '("a" " "))))
+(ert-deftest xdg-mime-associations ()
+ "Test reading MIME associations from files."
+ (let* ((apps (expand-file-name "mimeapps.list" xdg-tests-data-dir))
+ (cache (expand-file-name "mimeinfo.cache" xdg-tests-data-dir))
+ (fs (list apps cache)))
+ (should (equal (xdg-mime-collect-associations "x-test/foo" fs)
+ '("a.desktop" "b.desktop")))
+ (should (equal (xdg-mime-collect-associations "x-test/bar" fs)
+ '("a.desktop" "c.desktop")))
+ (should (equal (xdg-mime-collect-associations "x-test/baz" fs)
+ '("a.desktop" "b.desktop" "d.desktop")))))
+
;;; xdg-tests.el ends here