From ce14c424ee1d8340d949628b5eca6bdf808daab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 13 Feb 2022 22:11:22 +0100 Subject: Datetime test parse-month. --- tests/datetime.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/datetime.scm') diff --git a/tests/datetime.scm b/tests/datetime.scm index d1ebd238..eb9c02b6 100644 --- a/tests/datetime.scm +++ b/tests/datetime.scm @@ -14,6 +14,7 @@ datetime- leap-year? string->date string->time string->datetime + parse-month ) ((ice-9 format) format) ((hnh util) let*) @@ -226,3 +227,15 @@ (test-equal "Parse date single digit day, trailing comma + space" (date day: 6) (string->date "6, " "~d, ")) + + +(define en_US (make-locale LC_TIME "en_US.UTF-8")) +(define sv_SE (make-locale LC_TIME "sv_SE.UTF-8")) + +(test-equal 1 (parse-month "jan" en_US)) +(test-equal 1 (parse-month "jan" sv_SE)) + +(test-equal 12 (parse-month "dec" en_US)) +(test-equal -1 (parse-month "inv" en_US)) + +(test-equal 5 (parse-month "mAJ" sv_SE)) -- cgit v1.2.3