From 709c6f68da124d9fd916aa02f4bd95ca2c197db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 11 Jun 2022 23:08:41 +0200 Subject: Add to xhtml-doc macro. The doctype declaration is "required" when outputing regular HTML, and fine when output XHTML. Also remove the tests of xhtml-doc, since they basically just copied the deffinition (and stoped working since a procedure can't easily be tested for equality). --- module/calp/html/components.scm | 1 + tests/test/html/component.scm | 22 ---------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/module/calp/html/components.scm b/module/calp/html/components.scm index 9b3e4ce0..6ff59502 100644 --- a/module/calp/html/components.scm +++ b/module/calp/html/components.scm @@ -12,6 +12,7 @@ ((_ (@ attr ...) body ...) `(*TOP* (*PI* xml "version=\"1.0\" encoding=\"utf-8\"") + ,(lambda () (format #t "~%~%")) (html (@ (xmlns "http://www.w3.org/1999/xhtml") attr ...) body ...))) ((_ body ...) diff --git a/tests/test/html/component.scm b/tests/test/html/component.scm index 97581c50..050810be 100644 --- a/tests/test/html/component.scm +++ b/tests/test/html/component.scm @@ -7,28 +7,6 @@ :use-module (calp html components) ) -(test-equal '(*TOP* (*PI* xml "version=\"1.0\" encoding=\"utf-8\"") - (html (@ (xmlns "http://www.w3.org/1999/xhtml")) - body)) - (xhtml-doc body)) - -(test-equal '(*TOP* (*PI* xml "version=\"1.0\" encoding=\"utf-8\"") - (html (@ (xmlns "http://www.w3.org/1999/xhtml")) - (b "Hello, World!"))) - (xhtml-doc ,'(b "Hello, World!"))) - -(test-equal - '(*TOP* (*PI* xml "version=\"1.0\" encoding=\"utf-8\"") - (html (@ (xmlns "http://www.w3.org/1999/xhtml") - (lang sv)) - body)) - (xhtml-doc (@ (lang sv)) body)) - - -;; TODO Slider not tested, due to depending on gensyms, and really needing -;; integration testing to be worth anything. - - (test-equal '(button (@ (class "btn") (onclick "onclick")) "Body") (btn onclick: "onclick" "Body")) -- cgit v1.2.3