]> gitweb.factorcode.org Git - factor.git/commitdiff
tzinfo: adding tests for normalize.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 5 Sep 2013 01:54:57 +0000 (18:54 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 5 Sep 2013 01:54:57 +0000 (18:54 -0700)
extra/tzinfo/tests/US-Pacific [new file with mode: 0644]
extra/tzinfo/tzinfo-tests.factor [new file with mode: 0644]
extra/tzinfo/tzinfo.factor

diff --git a/extra/tzinfo/tests/US-Pacific b/extra/tzinfo/tests/US-Pacific
new file mode 100644 (file)
index 0000000..2460278
Binary files /dev/null and b/extra/tzinfo/tests/US-Pacific differ
diff --git a/extra/tzinfo/tzinfo-tests.factor b/extra/tzinfo/tzinfo-tests.factor
new file mode 100644 (file)
index 0000000..3cd5146
--- /dev/null
@@ -0,0 +1,16 @@
+USING: calendar formatting kernel tools.test ;
+
+IN: tzinfo
+
+{
+    "Sun Oct 27 01:00:00 2002"
+    "Sun Oct 27 01:50:00 2002"
+} [
+    2002 10 27 1 0 0 -8 hours <timestamp> ! PST
+    [ "%c" strftime ]
+    [
+        10 minutes time- ! to PDT
+        "vocab:tzinfo/tests/US-Pacific" file>tzinfo normalize
+        "%c" strftime
+    ] bi
+] unit-test
index cd840ae398a44d91c85e3b19203d43775aca63e7..15fa7a5bb8cf5bbe81656804dc46fd16ef652d3e 100644 (file)
@@ -1,3 +1,6 @@
+! Copyright (C) 2013 John Benediktsson
+! See http://factorcode.org/license.txt for BSD license
+
 USING: accessors alien.c-types alien.data alien.endian arrays
 assocs calendar classes.struct combinators hashtables io
 io.binary io.encodings.binary io.files kernel locals math