Improve hsx-test/hsx
This commit is contained in:
parent
ead5c408e3
commit
6daffb4ddf
1 changed files with 13 additions and 21 deletions
|
@ -2,11 +2,6 @@
|
|||
(:use #:cl
|
||||
#:fiveam
|
||||
#:hsx/hsx)
|
||||
(:import-from #:hsx/element
|
||||
#:element-type
|
||||
#:element-children)
|
||||
(:import-from #:hsx/defhsx
|
||||
#:defcomp)
|
||||
(:import-from #:hsx/builtin))
|
||||
(in-package #:hsx-test/hsx)
|
||||
|
||||
|
@ -14,20 +9,17 @@
|
|||
(def-suite hsx-test)
|
||||
(in-suite hsx-test)
|
||||
|
||||
(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"))))
|
||||
(is (equal (macroexpand-1
|
||||
'(hsx (div
|
||||
div
|
||||
(div
|
||||
div
|
||||
(div))
|
||||
div)))
|
||||
'(hsx/builtin:div
|
||||
div
|
||||
(hsx/builtin:div
|
||||
div
|
||||
(hsx/builtin:div))
|
||||
div))))
|
||||
|
|
Loading…
Reference in a new issue