ref: be4be6e3d87229e61cc4676e2e7bb8e995a99803
parent: 7e12266a87ef6ce06669e7da5091b6c70c73f177
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Sep 14 10:54:09 EDT 2015
Move to use implicit tests.
--- a/lib/date/bld.proj
+++ b/lib/date/bld.proj
@@ -7,4 +7,3 @@
zoneinfo.myr
;;
-sub = test ;;
--- a/lib/date/test/bld.sub
+++ /dev/null
@@ -1,2 +1,0 @@
-test ftime-test {inc=..} = ftime-test.myr ;;
-test parse-test {inc=..} = parse-test.myr ;;
--- /dev/null
+++ b/lib/date/test/fmt.myr
@@ -1,0 +1,19 @@
+use std
+use date
+
+const main = {
+ var buf : byte[1024]
+ var d
+ var f
+
+ /*Fri 29 Aug 2014 07:47:43 PM UTC*/
+ d = date.mkinstant(1_409_341_663*1_000_000, "")
+ f = std.bfmt(buf[:], "{D}", d)
+ eq("2014-8-29 19:47:43 +0000", f)
+}
+
+const eq = {expected, actual
+ if !std.sleq(expected, actual)
+ std.fatal("expected date {}, got {}\n", expected, actual)
+ ;;
+}
--- a/lib/date/test/ftime-test.myr
+++ /dev/null
@@ -1,19 +1,0 @@
-use std
-use date
-
-const main = {
- var buf : byte[1024]
- var d
- var f
-
- /*Fri 29 Aug 2014 07:47:43 PM UTC*/
- d = date.mkinstant(1_409_341_663*1_000_000, "")
- f = std.bfmt(buf[:], "{D}", d)
- eq("2014-8-29 19:47:43 +0000", f)
-}
-
-const eq = {expected, actual
- if !std.sleq(expected, actual)
- std.fatal("expected date {}, got {}\n", expected, actual)
- ;;
-}
--- a/lib/date/test/parse-test.myr
+++ /dev/null
@@ -1,20 +1,0 @@
-use std
-use date
-
-const main = {
- var buf : byte[1024]
-
- /*Fri 29 Aug 2014 07:47:43 PM UTC*/
- match date.parsefmt("%Y-%m-%d %z", "1932-10-23 +0500")
- | `std.Some d:
- eq(std.bfmt(buf[:], "{D}", d), "1932-10-23 00:0:0 +0500")
- | `std.None:
- std.fatal("Failed to parse date")
- ;;
-}
-
-const eq = {actual, expected
- if !std.sleq(expected, actual)
- std.fatal("expected date {}, got {}\n", expected, actual)
- ;;
-}
--- /dev/null
+++ b/lib/date/test/parse.myr
@@ -1,0 +1,20 @@
+use std
+use date
+
+const main = {
+ var buf : byte[1024]
+
+ /*Fri 29 Aug 2014 07:47:43 PM UTC*/
+ match date.parsefmt("%Y-%m-%d %z", "1932-10-23 +0500")
+ | `std.Some d:
+ eq(std.bfmt(buf[:], "{D}", d), "1932-10-23 00:0:0 +0500")
+ | `std.None:
+ std.fatal("Failed to parse date")
+ ;;
+}
+
+const eq = {actual, expected
+ if !std.sleq(expected, actual)
+ std.fatal("expected date {}, got {}\n", expected, actual)
+ ;;
+}