summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-11-20 21:28:55 +0100
committerAraq <rumpf_a@web.de>2012-11-20 21:28:55 +0100
commitc4b7a3e545d2fce998a91bc2e2f525a9e1984f5c (patch)
tree10316d5e6bc8a0eedc2b30b591e6ff713c77387c
parent3d408420889097a87919fc2f8e9e5de837a35506 (diff)
downloadNim-c4b7a3e545d2fce998a91bc2e2f525a9e1984f5c.tar.gz
docs should build under doc2; unittests of times.nim compile under 32bit; small bugfix for the tester
-rwxr-xr-xlib/pure/times.nim12
-rwxr-xr-xtests/tester.nim3
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index b0ce2454c..d84fbbb67 100755
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -684,12 +684,14 @@ when isMainModule:
     " ss t tt y yy yyy yyyy yyyyy z zz zzz ZZZ") ==
     "27 27 Mon Monday 4 04 16 16 6 06 1 01 Jan January 29 29 P PM 5 75 975 1975 01975 0 00 00:00 UTC"
   
-  var t3 = getGMTime(TTime(889067643645)) # Fri  7 Jun 19:20:45 BST 30143
-  assert t3.format("d dd ddd dddd h hh H HH m mm M MM MMM MMMM s" &
-    " ss t tt y yy yyy yyyy yyyyy z zz zzz ZZZ") == 
-    "7 07 Fri Friday 6 06 18 18 20 20 6 06 Jun June 45 45 P PM 3 43 143 0143 30143 0 00 00:00 UTC"
+  when sizeof(TTime) == 8:
+    var t3 = getGMTime(TTime(889067643645)) # Fri  7 Jun 19:20:45 BST 30143
+    assert t3.format("d dd ddd dddd h hh H HH m mm M MM MMM MMMM s" &
+      " ss t tt y yy yyy yyyy yyyyy z zz zzz ZZZ") == 
+      "7 07 Fri Friday 6 06 18 18 20 20 6 06 Jun June 45 45 P PM 3 43 143 0143 30143 0 00 00:00 UTC"
+    assert t3.format(":,[]()-/") == ":,[]()-/" 
   
   var t4 = getGMTime(TTime(876124714)) # Mon  6 Oct 08:58:34 BST 1997
   assert t4.format("M MM MMM MMMM") == "10 10 Oct October"
   
-  assert t3.format(":,[]()-/") == ":,[]()-/" 
\ No newline at end of file
+  
\ No newline at end of file
diff --git a/tests/tester.nim b/tests/tester.nim
index 259330805..8156dab7f 100755
--- a/tests/tester.nim
+++ b/tests/tester.nim
@@ -56,7 +56,8 @@ proc extractSpec(filename: string): string =
   var x = readFile(filename).string
   var a = x.find(tripleQuote)
   var b = x.find(tripleQuote, a+3)
-  if a >= 0 and b > a:
+  # look for """ only in the first section
+  if a >= 0 and b > a and a < 40:
     result = x.substr(a+3, b-1).replace("'''", tripleQuote)
   else:
     #echo "warning: file does not contain spec: " & filename