Minify props string
This commit is contained in:
parent
6f8df3e00d
commit
b430b42699
5 changed files with 61 additions and 33 deletions
|
@ -1,14 +0,0 @@
|
|||
(defpackage #:hsx-test/escaper
|
||||
(:use #:cl
|
||||
#:rove
|
||||
#:hsx/escaper))
|
||||
(in-package #:hsx-test/escaper)
|
||||
|
||||
(deftest escaper-test
|
||||
(testing "escape-html-attribute"
|
||||
(ok (string= ""foo""
|
||||
(escape-html-attribute "\"foo\""))))
|
||||
|
||||
(testing "escape-html-text-content"
|
||||
(ok (string= "&<>"'/`="
|
||||
(escape-html-text-content "&<>\"'/`=")))))
|
23
tests/utils.lisp
Normal file
23
tests/utils.lisp
Normal file
|
@ -0,0 +1,23 @@
|
|||
(defpackage #:hsx-test/utils
|
||||
(:use #:cl
|
||||
#:rove
|
||||
#:hsx/utils))
|
||||
(in-package #:hsx-test/utils)
|
||||
|
||||
(deftest text-util-test
|
||||
(testing "escape-html-attribute"
|
||||
(ok (string= ""foo""
|
||||
(escape-html-attribute "\"foo\""))))
|
||||
|
||||
(testing "escape-html-text-content"
|
||||
(ok (string= "&<>"'/`="
|
||||
(escape-html-text-content "&<>\"'/`="))))
|
||||
|
||||
(testing "minify"
|
||||
;; Test with Alpine.js
|
||||
(ok (string= (minify "{
|
||||
open: false,
|
||||
get isOpen() { return this.open },
|
||||
toggle() { this.open = ! this.open },
|
||||
}")
|
||||
"{ open: false, get isOpen() { return this.open }, toggle() { this.open = ! this.open }, }"))))
|
Loading…
Add table
Add a link
Reference in a new issue