summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorProtesilaos Stavrou <info@protesilaos.com>2026-04-10 16:24:52 +0300
committerProtesilaos Stavrou <info@protesilaos.com>2026-04-10 16:24:52 +0300
commitd2f64a8a4fa0e6e7a34dc5044cdd6e76b8c888d4 (patch)
tree31787cb5a0632fcd1cb1f2c3d7e42d9322e8a884
parentf430f287bdabbeda7e75823b49fdaabde64fc4fb (diff)
Write test for modus-themes-sort
-rw-r--r--tests/modus-themes-test.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/modus-themes-test.el b/tests/modus-themes-test.el
index 759a6b4..34912a9 100644
--- a/tests/modus-themes-test.el
+++ b/tests/modus-themes-test.el
@@ -128,6 +128,22 @@ Also see `modus-themes-test--modus-themes--hex-to-rgb'."
(should-not (modus-themes--background-p 'modus-operandi t))
(should-not (modus-themes--background-p 'modus-operandi :light)))
+(mtt-define-test modus-themes-sort nil
+ (let ((first-has-prefix-fn (lambda (themes prefix)
+ (when-let* ((first (car themes))
+ (name (symbol-name first)))
+ (string-match-p prefix name)))))
+ (should
+ (funcall
+ first-has-prefix-fn
+ (modus-themes-sort (reverse modus-themes-items) 'light)
+ "modus-operandi"))
+ (should
+ (funcall
+ first-has-prefix-fn
+ (modus-themes-sort modus-themes-items 'dark)
+ "modus-vivendi"))))
+
(mtt-define-test inheritance
"Ensure all faces inherit from valid faces."
;; Third-party packages, loaded if possible to better test face inheritance.