hsx/tests/hsx.lisp

34 lines
888 B
Common Lisp
Raw Normal View History

2024-05-25 16:26:26 +00:00
(defpackage #:hsx-test/hsx
(:use #:cl
#:fiveam
#:hsx/hsx)
2024-05-26 03:26:09 +00:00
(:import-from #:hsx/element
#:element-type
#:element-children)
(:import-from #:hsx/defhsx
#:defcomp)
(:import-from #:hsx/builtin))
2024-05-25 16:26:26 +00:00
(in-package #:hsx-test/hsx)
2024-05-26 03:26:09 +00:00
(def-suite hsx-test)
(in-suite hsx-test)
2024-05-27 02:10:11 +00:00
(defcomp div (&rest props)
(declare (ignore props))
"This is fake!")
(defcomp p (&rest props)
(declare (ignore props))
"This is fake!")
(test find-symbols
(let ((fake-elm (div :prop "value"
(p "brah"))))
(is (eql (element-type fake-elm) #'%div)
(eql (element-type (first (element-children fake-elm))) #'%p)))
(let ((true-elm (hsx (div :prop "value"
(p "brah")))))
(is (equal (element-type true-elm) "div")
(equal (element-type (first (element-children true-elm))) "p"))))