From 91ae7b28ae8b7b161b2115a8cd11de0ef261d1be Mon Sep 17 00:00:00 2001 From: haolin xu Date: Tue, 25 Feb 2025 17:11:20 +0800 Subject: [PATCH 1/3] add tests in htmltm-test.scm --- tests/htmltm-test.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/htmltm-test.scm b/tests/htmltm-test.scm index 2b2e24d..9a55bd7 100644 --- a/tests/htmltm-test.scm +++ b/tests/htmltm-test.scm @@ -52,6 +52,15 @@ (check (shtml->stm '(a (@ (href "%60hello%20world%60")) "`how are you?`")) => '(hlink "\x00;how are you?\x00;" "%60hello%20world%60"))) +(define (regtest-htmltm-formatting) + (check (shtml->stm '(b "test")) => '(document (with "font-series" "bold" "test"))) + (check (shtml->stm '(em "test")) => '(document (em "test"))) + (check (shtml->stm '(i "test")) => '(document (with "font-shape" "italic" "test"))) + (check (shtml->stm '(small "test")) => '(document (with "font-size" "0.83" "test"))) + (check (shtml->stm '(strong "test")) => '(document (strong "test"))) + (check (shtml->stm '("test" (sub "sub"))) => '(document (concat "test" (rsub "sub")))) + (check (shtml->stm '("test" (sup "sup"))) => '(document (concat "test" (rsup "sup"))))) + (tm-define (htmltm-test) (regtest-htmltm-headings) (regtest-htmltm-grouping) From a4473ce3fff4c9ff47b380437449bff93c9c2345 Mon Sep 17 00:00:00 2001 From: haolin xu Date: Tue, 25 Feb 2025 17:26:27 +0800 Subject: [PATCH 2/3] fix bug --- tests/htmltm-test.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/htmltm-test.scm b/tests/htmltm-test.scm index 9a55bd7..066c11f 100644 --- a/tests/htmltm-test.scm +++ b/tests/htmltm-test.scm @@ -65,4 +65,5 @@ (regtest-htmltm-headings) (regtest-htmltm-grouping) (regtest-htmltm-quote) + (regtest-htmltm-formatting) (check-report)) From 32b742c224885b35e6e7ce7780e94301cc1bb1ac Mon Sep 17 00:00:00 2001 From: haolin xu Date: Tue, 25 Feb 2025 17:54:52 +0800 Subject: [PATCH 3/3] fix bug --- tests/htmltm-test.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/htmltm-test.scm b/tests/htmltm-test.scm index 066c11f..946bdcb 100644 --- a/tests/htmltm-test.scm +++ b/tests/htmltm-test.scm @@ -53,13 +53,13 @@ => '(hlink "\x00;how are you?\x00;" "%60hello%20world%60"))) (define (regtest-htmltm-formatting) - (check (shtml->stm '(b "test")) => '(document (with "font-series" "bold" "test"))) - (check (shtml->stm '(em "test")) => '(document (em "test"))) - (check (shtml->stm '(i "test")) => '(document (with "font-shape" "italic" "test"))) - (check (shtml->stm '(small "test")) => '(document (with "font-size" "0.83" "test"))) - (check (shtml->stm '(strong "test")) => '(document (strong "test"))) - (check (shtml->stm '("test" (sub "sub"))) => '(document (concat "test" (rsub "sub")))) - (check (shtml->stm '("test" (sup "sup"))) => '(document (concat "test" (rsup "sup"))))) + (check (shtml->stm '(b "test")) => '(with "font-series" "bold" "test")) + (check (shtml->stm '(em "test")) => '(em "test")) + (check (shtml->stm '(i "test")) => '(with "font-shape" "italic" "test")) + (check (shtml->stm '(small "test")) => '(with "font-size" "0.83" "test")) + (check (shtml->stm '(strong "test")) => '(strong "test")) + (check (shtml->stm '("test" (sub "sub"))) => '(rsub "sub")) + (check (shtml->stm '("test" (sup "sup"))) => '(rsup "sup"))) (tm-define (htmltm-test) (regtest-htmltm-headings)