emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/alect-themes fb91899 210/269: Add (unignore) tests


From: ELPA Syncer
Subject: [nongnu] elpa/alect-themes fb91899 210/269: Add (unignore) tests
Date: Thu, 21 Oct 2021 17:59:21 -0400 (EDT)

branch: elpa/alect-themes
commit fb9189959550481c839f3e21e34bf617a4903c1f
Author: Alex Kost <alezost@gmail.com>
Commit: Alex Kost <alezost@gmail.com>

    Add (unignore) tests
    
    * tests/alect-tests.el: New file.
    * .gitignore: Remove "alect-test.el" line.
---
 .gitignore           |  1 -
 tests/alect-tests.el | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 25f94eb..f11089f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
 *.elc
 screenshots
-alect-test.el
 tmp
 *-autoloads.el
diff --git a/tests/alect-tests.el b/tests/alect-tests.el
new file mode 100644
index 0000000..bc70dfa
--- /dev/null
+++ b/tests/alect-tests.el
@@ -0,0 +1,66 @@
+;;; alect-tests.el --- Tests for alect-themes package
+
+;; Copyright © 2013, 2016 Alex Kost <alezost@gmail.com>
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; These tests can be run like this:
+;;
+;;   cd /path/to/alect-themes
+;;   emacs -Q -nw -L . --batch --eval '(progn (load-file 
"tests/alect-tests.el") (ert-run-tests-batch-and-exit))'
+
+;;; Code:
+
+(require 'ert)
+(require 'alect-themes)
+
+(ert-deftest alect-test-substitute-colors ()
+  "Test functions for substituting colors."
+  (should (equal (alect-substitute-color
+                  'dark '(:foreground "pink" :background green-1) :foreground)
+                 '(:foreground "pink" :background green-1)))
+  (should (equal (alect-substitute-color
+                  'dark '(:foreground "pink" :background green-1) :background)
+                 '(:foreground "pink" :background "#32cd32")))
+  (should (equal (alect-substitute-colors-in-plist
+                  'light '(((:foreground "pink" :background green-1 :underline 
t
+                                         :box (:line-width 1 :color fg :style 
nil)))))
+                 '(:foreground "pink" :background "#1c9e28" :underline t
+                               :box (:line-width 1 :color "#3f3f3f" :style 
nil))))
+  (should (equal (alect-substitute-colors-in-faces
+                  'light
+                  '((fringe ((t (:background "pink"))))
+                    (font-lock-string-face ((t :foreground green-1)))
+                    (button ((((class color) (min-colors 88) (:background 
blue)) (:foreground magenta))
+                             (((class color) (background dark)) :foreground 
"LightSkyBlue")
+                             (((class color) (min-colors 16)) (:bold t 
:background fg+2))
+                             (t (:slant italic :box (:line-width 1 :color 
red-1 :background cyan)))))))
+                 '((fringe ((t :background "pink")))
+                   (font-lock-string-face ((t :foreground "#1c9e28")))
+                   (button ((((class color) (min-colors 88) (:background 
blue)) :foreground "#a020f0")
+                            (((class color) (background dark)) :foreground 
"LightSkyBlue")
+                            (((class color) (min-colors 16)) :bold t 
:background "#101010")
+                            (t :slant italic :box (:line-width 1 :color 
"#e43838" :background cyan)))))))
+  (should (equal (alect-substitute-colors-in-faces
+                  'dark
+                  '((hl-line ((((class color) (min-colors 256)) :background bg)
+                              (t nil)))))
+                 '((hl-line ((((class color) (min-colors 256)) :background 
"#4f4f4f")
+                             (t nil)))))))
+
+(provide 'alect-tests)
+
+;;; alect-tests.el ends here



reply via email to

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