23 lines
783 B
Common Lisp
23 lines
783 B
Common Lisp
(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 }, }"))))
|