From ed4281ff072443167c43207c039570126061d23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 12 Apr 2022 13:30:32 +0200 Subject: Add a lot of new unit tests. --- tests/test/crypto.scm | 3 + tests/test/datetime.scm | 214 +++++++++++++++++++++++++++++++++++-- tests/test/html/caltable.scm | 105 ++++++++++++++++++ tests/test/html/component.scm | 59 ++++++++++ tests/test/recurrence-advanced.scm | 34 +++++- tests/test/srfi-41-util.scm | 58 ++++++++-- tests/test/translation.scm | 15 +++ tests/test/util.scm | 148 ++++++++++++++++++++++--- tests/test/uuid.scm | 12 +++ 9 files changed, 614 insertions(+), 34 deletions(-) create mode 100644 tests/test/html/caltable.scm create mode 100644 tests/test/html/component.scm create mode 100644 tests/test/translation.scm create mode 100644 tests/test/uuid.scm (limited to 'tests/test') diff --git a/tests/test/crypto.scm b/tests/test/crypto.scm index 71ecfc99..8d195fa8 100644 --- a/tests/test/crypto.scm +++ b/tests/test/crypto.scm @@ -13,3 +13,6 @@ (test-equal "sha256 string digest to port" "185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969" (get-output-string port))) + +(test-error 'wrong-type-arg + (sha256 'something-which-is-not-a-string-or-bytevector)) diff --git a/tests/test/datetime.scm b/tests/test/datetime.scm index d9c08ec2..8648006b 100644 --- a/tests/test/datetime.scm +++ b/tests/test/datetime.scm @@ -12,7 +12,7 @@ :use-module ((ice-9 format) :select (format)) :use-module ((hnh util) :select (let*)) :use-module ((ice-9 i18n) :select (make-locale)) - :use-module ((guile) :select (LC_TIME))) + :use-module ((guile) :select (LC_CTYPE LC_TIME))) (test-equal "empty time" @@ -55,6 +55,17 @@ "~a" #2020-01-01)) +(test-equal "time print" + "#20:30:40" + (format #f "~a" #20:30:40)) + +(test-equal "time print bad" + "#<