Rename hsx/hsx to hsx/dsl
This commit is contained in:
parent
bc2bc378c7
commit
7f276120aa
5 changed files with 10 additions and 10 deletions
tests
67
tests/dsl.lisp
Normal file
67
tests/dsl.lisp
Normal file
|
@ -0,0 +1,67 @@
|
|||
(defpackage #:hsx-test/dsl
|
||||
(:use #:cl
|
||||
#:rove
|
||||
#:hsx/dsl
|
||||
#:hsx/builtin)
|
||||
(:import-from #:hsx/element
|
||||
#:element-props
|
||||
#:element-children))
|
||||
(in-package #:hsx-test/dsl)
|
||||
|
||||
(deftest dsl-test
|
||||
(testing "find-symbols"
|
||||
(ok (expands
|
||||
'(hsx (div '(:div "div")
|
||||
div
|
||||
(div
|
||||
'div
|
||||
(div)
|
||||
:div)
|
||||
"div"))
|
||||
'(hsx/builtin:div '(:div "div")
|
||||
div
|
||||
(hsx/builtin:div
|
||||
'div
|
||||
(hsx/builtin:div)
|
||||
:div)
|
||||
"div"))))
|
||||
|
||||
(testing "empty-hsx"
|
||||
(let ((elm (div)))
|
||||
(ok (null (element-props elm)))
|
||||
(ok (null (element-children elm)))))
|
||||
|
||||
(testing "hsx-with-static-props"
|
||||
(let ((elm (div :prop1 "value1" :prop2 "value2")))
|
||||
(ok (equal '(:prop1 "value1" :prop2 "value2")
|
||||
(element-props elm)))
|
||||
(ok (null (element-children elm)))))
|
||||
|
||||
(testing "hsx-with-dynamic-props"
|
||||
(let* ((props '(:prop1 "value1" :prop2 "value2"))
|
||||
(elm (div props)))
|
||||
(ok (equal props (element-props elm)))
|
||||
(ok (null (element-children elm)))))
|
||||
|
||||
(testing "hsx-with-children"
|
||||
(let ((elm (div
|
||||
"child1"
|
||||
"child2")))
|
||||
(ok (null (element-props elm)))
|
||||
(ok (equal (list "child1" "child2") (element-children elm)))))
|
||||
|
||||
(testing "hsx-with-static-props-and-children"
|
||||
(let ((elm (div :prop1 "value1" :prop2 "value2"
|
||||
"child1"
|
||||
"child2")))
|
||||
(ok (equal '(:prop1 "value1" :prop2 "value2")
|
||||
(element-props elm)))
|
||||
(ok (equal (list "child1" "child2") (element-children elm)))))
|
||||
|
||||
(testing "hsx-with-dynamic-props-and-children"
|
||||
(let* ((props '(:prop1 "value1" :prop2 "value2"))
|
||||
(elm (div props
|
||||
"child1"
|
||||
"child2")))
|
||||
(ok (equal props (element-props elm)))
|
||||
(ok (equal (list "child1" "child2") (element-children elm))))))
|
Loading…
Add table
Add a link
Reference in a new issue