]> gitweb.factorcode.org Git - factor.git/commitdiff
fix a bug when printing calendars, add a unit test
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 12 Oct 2009 21:55:52 +0000 (16:55 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 12 Oct 2009 21:55:52 +0000 (16:55 -0500)
basis/calendar/format/format-tests.factor
basis/calendar/format/format.factor

index f8864351a44dfe54c951dcb87ceda875192201ac..cb1ff0b60f2e11d717c967fd0e7ee6a9d0ec76bb 100644 (file)
@@ -1,5 +1,5 @@
 USING: calendar.format calendar kernel math tools.test\r
-io.streams.string accessors io math.order ;\r
+io.streams.string accessors io math.order sequences ;\r
 IN: calendar.format.tests\r
 \r
 [ 0 ] [\r
@@ -81,3 +81,5 @@ IN: calendar.format.tests
 ] [ "Thursday, 02-Oct-2008 23:59:59 GMT" cookie-string>timestamp ] unit-test\r
 \r
 \r
+[ ]\r
+[ { 2008 2009 } [ year. ] each ] unit-test\r
index 6aa4126ff920f913ea4a7cd3e7b986793020c122..d07d74722a71de9c45ad58b231d55b71acd54a3b 100644 (file)
@@ -66,7 +66,7 @@ M: array month. ( pair -- )
     [ month-name write bl number>string print ]\r
     [ 1 zeller-congruence ]\r
     [ (days-in-month) day-abbreviations2 " " join print ] 2tri\r
-    over "   " <repetition> concat write\r
+    over "   " <repetition> "" concat-as write\r
     [\r
         [ 1 + day. ] keep\r
         1 + + 7 mod zero? [ nl ] [ bl ] if\r