Check for string instead of keyword

This commit is contained in:
Marcus Kammer 2023-07-23 19:43:15 +02:00
parent 2e556853d7
commit a4e62b04de
2 changed files with 6 additions and 4 deletions

View file

@ -163,9 +163,11 @@ Example 3:
Example 4:
(opacity :level :auto)
; This will generate a string 'opacity-auto'"
(let ((level-str (if (null level) "" (if (eq level :auto)
"opacity-auto"
(format nil "opacity-~d" level)))))
(let ((level-str (if (null level)
""
(if (equal level "auto")
"opacity-auto"
(format nil "opacity-~d" level)))))
(string-clean (concatenate 'string level-str))))
(defun overflow (&key (direction nil) (value nil))

View file

@ -86,7 +86,7 @@
(deftest test-opacity-auto
(testing "Generates correct opacity class for auto"
(ok (string= (opacity :level :auto) "opacity-auto"))))
(ok (string= (opacity :level "auto") "opacity-auto"))))
(deftest test-opacity-no-arguments
(testing "Generates correct opacity class with no arguments"