summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2016-08-27 20:52:26 +0200
committerAraq <rumpf_a@web.de>2016-08-27 20:52:26 +0200
commit884d5518dd824ff451caf5689624c824a73520d5 (patch)
tree1069304c1c36814b413ebd54bf4680c977e1d2df /tests
parent68e30d7d52d84578fbe0f6f1c2041b150251e800 (diff)
parent7e643d73788fd0799cc970601bc75592e9610039 (diff)
downloadNim-884d5518dd824ff451caf5689624c824a73520d5.tar.gz
Merged
Diffstat (limited to 'tests')
-rw-r--r--tests/array/troof2.nim4
-rw-r--r--tests/async/tioselectors.nim8
-rw-r--r--tests/bind/tnicerrorforsymchoice.nim2
-rw-r--r--tests/ccgbugs/twrong_rc_for_refarray.nim26
-rw-r--r--tests/closure/tclosure4.nim2
-rw-r--r--tests/collections/ttables.nim23
-rw-r--r--tests/collections/ttablesref.nim25
-rw-r--r--tests/distinct/tcurrncy.nim8
-rw-r--r--tests/effects/tsidee4.nim6
-rw-r--r--tests/generics/tlamba_in_generic.nim13
-rw-r--r--tests/generics/ttempl_in_generic.nim8
-rw-r--r--tests/iter/tcomplex_openarray.nim33
-rw-r--r--tests/js/tunittests.nim4
-rw-r--r--tests/macros/tgettype2.nim67
-rw-r--r--tests/metatype/twildtypedesc.nim43
-rw-r--r--tests/stdlib/tnet_ll.nim3
-rw-r--r--tests/stdlib/tparseuints.nim2
-rw-r--r--tests/stdlib/ttime.nim70
-rw-r--r--tests/template/ttemp_in_varargs.nim9
-rw-r--r--tests/vm/tconst_float_as_int.nim3
20 files changed, 305 insertions, 54 deletions
diff --git a/tests/array/troof2.nim b/tests/array/troof2.nim
index d4c1a4982..e4b4f4b3c 100644
--- a/tests/array/troof2.nim
+++ b/tests/array/troof2.nim
@@ -2,8 +2,8 @@ discard """
   errormsg: "invalid context for '^' as 'foo()' has side effects"
   line: "9"
 """
-
-proc foo(): seq[int] =
+# XXX This needs to be fixed properly!
+proc foo(): seq[int] {.sideEffect.} =
   echo "ha"
 
 let f = foo()[^1]
diff --git a/tests/async/tioselectors.nim b/tests/async/tioselectors.nim
index ed2fea84f..2237de01a 100644
--- a/tests/async/tioselectors.nim
+++ b/tests/async/tioselectors.nim
@@ -79,7 +79,7 @@ when not defined(windows):
     var rc2 = selector.select(100)
     assert(len(rc2) == 1)
 
-    var read_count = posix.recv(server2_socket, addr (buffer[0]), 128, 0)
+    var read_count = posix.recv(server2_socket, addr buffer[0], 128, 0)
     if read_count == -1:
       raiseOSError(osLastError())
 
@@ -233,7 +233,7 @@ when not defined(windows):
 
     proc mt_event_test(): bool =
       var
-        thr: array [0..7, Thread[SelectEvent]]
+        thr: array[0..7, Thread[SelectEvent]]
       var selector = newSelector[int]()
       var sock = newNativeSocket()
       var event = newSelectEvent()
@@ -317,7 +317,7 @@ else:
     var rc2 = selector.select(100)
     assert(len(rc2) == 1)
 
-    var read_count = recv(server2_socket, addr (buffer[0]), 128, 0)
+    var read_count = recv(server2_socket, addr buffer[0], 128, 0)
     if read_count == -1:
       raiseOSError(osLastError())
 
@@ -391,7 +391,7 @@ else:
       assert(selector.isEmpty())
 
     proc mt_event_test(): bool =
-      var thr: array [0..7, Thread[SelectEvent]]
+      var thr: array[0..7, Thread[SelectEvent]]
       var event = newSelectEvent()
       for i in 0..high(thr):
         createThread(thr[i], event_wait_thread, event)
diff --git a/tests/bind/tnicerrorforsymchoice.nim b/tests/bind/tnicerrorforsymchoice.nim
index 5145fdcff..bd00188fa 100644
--- a/tests/bind/tnicerrorforsymchoice.nim
+++ b/tests/bind/tnicerrorforsymchoice.nim
@@ -1,6 +1,6 @@
 discard """
   line: 18
-  errormsg: "type mismatch: got (proc (s: TScgi) | proc (client: AsyncSocket, headers: StringTableRef, input: string){.gcsafe, locks: 0.}"
+  errormsg: "type mismatch: got (proc (s: TScgi) | proc (client: AsyncSocket, headers: StringTableRef, input: string){.noSideEffect, gcsafe, locks: 0.}"
 """
 
 #bug #442
diff --git a/tests/ccgbugs/twrong_rc_for_refarray.nim b/tests/ccgbugs/twrong_rc_for_refarray.nim
new file mode 100644
index 000000000..99bdac5e1
--- /dev/null
+++ b/tests/ccgbugs/twrong_rc_for_refarray.nim
@@ -0,0 +1,26 @@
+discard """
+  output: '''m[0][0] = 1.0
+m[0][0] = 2.0'''
+"""
+# bug #4653
+type
+  Vector = ref array[2, float64]
+  Matrix = ref array[2, Vector]
+
+proc newVector(): Vector =
+  new(result)
+
+proc newMatrix(): Matrix =
+  new(result)
+  for ix in 0 .. 1:
+    result[ix] = newVector()
+
+let m = newMatrix()
+
+m[0][0] = 1.0
+echo "m[0][0] = ", m[0][0]
+
+GC_fullCollect()
+
+m[0][0] = 2.0
+echo "m[0][0] = ", m[0][0]
diff --git a/tests/closure/tclosure4.nim b/tests/closure/tclosure4.nim
index 69c076cd5..bc134ded6 100644
--- a/tests/closure/tclosure4.nim
+++ b/tests/closure/tclosure4.nim
@@ -1,7 +1,7 @@
 
 import json, tables, sequtils
 
-proc run(json_params: Table) =
+proc run(json_params: OrderedTable) =
   let json_elems = json_params["files"].elems
   # These fail compilation.
   var files = map(json_elems, proc (x: JsonNode): string = x.str)
diff --git a/tests/collections/ttables.nim b/tests/collections/ttables.nim
index a8a182a78..59fef4920 100644
--- a/tests/collections/ttables.nim
+++ b/tests/collections/ttables.nim
@@ -134,6 +134,29 @@ block mpairsTableTest1:
 block SyntaxTest:
   var x = toTable[int, string]({:})
 
+# Until #4448 is fixed, these tests will fail
+when false:
+  block clearTableTest:
+    var t = data.toTable
+    assert t.len() != 0
+    t.clear()
+    assert t.len() == 0
+
+  block clearOrderedTableTest:
+    var t = data.toOrderedTable
+    assert t.len() != 0
+    t.clear()
+    assert t.len() == 0
+
+  block clearCountTableTest:
+    var t = initCountTable[string]()
+    t.inc("90", 3)
+    t.inc("12", 2)
+    t.inc("34", 1)
+    assert t.len() != 0
+    t.clear()
+    assert t.len() == 0
+
 proc orderedTableSortTest() =
   var t = initOrderedTable[string, int](2)
   for key, val in items(data): t[key] = val
diff --git a/tests/collections/ttablesref.nim b/tests/collections/ttablesref.nim
index 32494f1f2..12af1ccbb 100644
--- a/tests/collections/ttablesref.nim
+++ b/tests/collections/ttablesref.nim
@@ -141,6 +141,31 @@ block anonZipTest:
   let values = @[1, 2, 3]
   doAssert "{a: 1, b: 2, c: 3}" == $ toTable zip(keys, values)
 
+block clearTableTest:
+  var t = newTable[string, float]()
+  t["test"] = 1.2345
+  t["111"] = 1.000043
+  t["123"] = 1.23
+  assert t.len() != 0
+  t.clear()
+  assert t.len() == 0
+
+block clearOrderedTableTest:
+  var t = newOrderedTable[string, int](2)
+  for key, val in items(data): t[key] = val
+  assert t.len() != 0
+  t.clear()
+  assert t.len() == 0
+
+block clearCountTableTest:
+  var t = newCountTable[string]()
+  t.inc("90", 3)
+  t.inc("12", 2)
+  t.inc("34", 1)
+  assert t.len() != 0
+  t.clear()
+  assert t.len() == 0
+
 orderedTableSortTest()
 echo "true"
 
diff --git a/tests/distinct/tcurrncy.nim b/tests/distinct/tcurrncy.nim
index 7ad4caea4..2675de739 100644
--- a/tests/distinct/tcurrncy.nim
+++ b/tests/distinct/tcurrncy.nim
@@ -2,7 +2,7 @@ discard """
   file: "tcurrncy.nim"
   output: "25"
 """
-template Additive(typ: typeDesc): stmt =
+template Additive(typ: untyped) =
   proc `+` *(x, y: typ): typ {.borrow.}
   proc `-` *(x, y: typ): typ {.borrow.}
 
@@ -10,18 +10,18 @@ template Additive(typ: typeDesc): stmt =
   proc `+` *(x: typ): typ {.borrow.}
   proc `-` *(x: typ): typ {.borrow.}
 
-template Multiplicative(typ, base: typeDesc): stmt {.immediate.} =
+template Multiplicative(typ, base: untyped) =
   proc `*` *(x: typ, y: base): typ {.borrow.}
   proc `*` *(x: base, y: typ): typ {.borrow.}
   proc `div` *(x: typ, y: base): typ {.borrow.}
   proc `mod` *(x: typ, y: base): typ {.borrow.}
 
-template Comparable(typ: typeDesc): stmt =
+template Comparable(typ: untyped) =
   proc `<` * (x, y: typ): bool {.borrow.}
   proc `<=` * (x, y: typ): bool {.borrow.}
   proc `==` * (x, y: typ): bool {.borrow.}
 
-template DefineCurrency(typ, base: expr): stmt {.immediate.} =
+template DefineCurrency(typ, base: untyped) =
   type
     typ* = distinct base
   Additive(typ)
diff --git a/tests/effects/tsidee4.nim b/tests/effects/tsidee4.nim
index 2cb88a23e..ecc79580c 100644
--- a/tests/effects/tsidee4.nim
+++ b/tests/effects/tsidee4.nim
@@ -1,13 +1,13 @@
 discard """
   file: "tsidee4.nim"
-  line: 15
-  errormsg: "type mismatch"
+  line: 12
+  errormsg: "'noSideEffect' can have side effects"
 """
 
 var
   global: int
 
-proc dontcare(x: int): int = return x
+proc dontcare(x: int): int = return global
 
 proc noSideEffect(x, y: int, p: proc (a: int): int {.noSideEffect.}): int {.noSideEffect.} =
   return x + y + dontcare(x)
diff --git a/tests/generics/tlamba_in_generic.nim b/tests/generics/tlamba_in_generic.nim
new file mode 100644
index 000000000..91d417b5e
--- /dev/null
+++ b/tests/generics/tlamba_in_generic.nim
@@ -0,0 +1,13 @@
+discard """
+  output: '''!!Hi!!'''
+"""
+# bug #4658
+import future
+
+var x = 123
+
+proc twice[T](f: T -> T): T -> T = (x: T) => f(f(x))
+
+proc quote(s: string): string = "!" & s & "!"
+
+echo twice(quote)("Hi")
diff --git a/tests/generics/ttempl_in_generic.nim b/tests/generics/ttempl_in_generic.nim
new file mode 100644
index 000000000..f04b9d216
--- /dev/null
+++ b/tests/generics/ttempl_in_generic.nim
@@ -0,0 +1,8 @@
+
+# bug #4600
+template foo(x: untyped): untyped = echo 1
+template foo(x,y: untyped): untyped = echo 2
+
+proc bar1[T](x: T) = foo(x)
+proc bar2(x: float) = foo(x,x)
+proc bar3[T](x: T) = foo(x,x)
diff --git a/tests/iter/tcomplex_openarray.nim b/tests/iter/tcomplex_openarray.nim
new file mode 100644
index 000000000..6fc191e90
--- /dev/null
+++ b/tests/iter/tcomplex_openarray.nim
@@ -0,0 +1,33 @@
+
+# bug #3221
+
+import algorithm, math, sequtils
+
+
+iterator permutations[T](ys: openarray[T]): seq[T] =
+  var
+    d = 1
+    c = newSeq[int](ys.len)
+    xs = newSeq[T](ys.len)
+  for i, y in ys: xs[i] = y
+  yield xs
+  block outer:
+    while true:
+      while d > 1:
+        dec d
+        c[d] = 0
+      while c[d] >= d:
+        inc d
+        if d >= ys.len: break outer
+      let i = if (d and 1) == 1: c[d] else: 0
+      swap xs[i], xs[d]
+      yield xs
+      inc c[d]
+
+proc dig_vectors(): void =
+  var v_nums: seq[int]
+  v_nums = newSeq[int](1)
+  for perm in permutations(toSeq(0 .. 1)):
+    v_nums[0] = 1
+
+dig_vectors()
diff --git a/tests/js/tunittests.nim b/tests/js/tunittests.nim
index 4b09c99a9..7c2e70563 100644
--- a/tests/js/tunittests.nim
+++ b/tests/js/tunittests.nim
@@ -1,5 +1,7 @@
 discard """
-  output: '''[OK] >:)'''
+  output: '''
+[Suite] Bacon
+  [OK] >:)'''
 """
 
 import unittest
diff --git a/tests/macros/tgettype2.nim b/tests/macros/tgettype2.nim
new file mode 100644
index 000000000..f129e6e1b
--- /dev/null
+++ b/tests/macros/tgettype2.nim
@@ -0,0 +1,67 @@
+
+import macros, typetraits
+
+type Foo = distinct int
+type Bar = distinct int
+type Baz = int
+
+let foo = 0.Foo
+let bar = 1.Bar
+let baz = 2.Baz
+
+type MyType[T] = distinct tuple[a,b:T]
+type MySimpleType = distinct tuple[a,b: int]
+
+var v: seq[int]
+var vv: seq[float]
+var t: MyType[int]
+var tt: MyType[float]
+var s: MySimpleType
+
+echo "############"
+echo "#### gt ####"
+echo "############"
+
+macro gt(a: typed): string =
+  let b = a.getType
+  var str = "gt(" & $a & "):\t" & b.repr
+  if b.kind == nnkSym: # bad predicat to check weather the type has an implementation
+    str = str & ", " & b.getType.repr  # append the implementation to the result
+  result = newLit(str)
+
+echo gt(Foo) # typeDesc[Foo]
+echo gt(Bar) # typeDesc[Bar]
+echo gt(Baz) # typeDesc[int]     shouldn't it be typeDesc[Baz]?
+echo gt(foo) # distinct[int]     I would prefer Foo, distinct[int]
+echo gt(bar) # distinct[int]     I would prefer Bar, distinct[int]
+echo gt(baz) # int, int          I would prefer Baz, int
+
+echo gt(v)   # seq[int], ok
+echo gt(vv)  # seq[float], ok
+echo gt(t)   # MyType, distinct[tuple[int, int]]      I would prefer MyType[int],   distinct[tuple[int, int]]
+echo gt(tt)  # MyType, distinct[tuple[float, float]]  I would prefer MyType[float], distinct[tuple[int, int]]
+echo gt(s)   # distinct[tuple[int, int]]              I would prefer MySimpleType, distinct[tuple[int,int]]
+
+echo "#############"
+echo "#### gt2 ####"
+echo "#############"
+
+# get type name via typetraits
+
+macro gt2(a: typed): string =
+  let prefix = "gt2(" & $a & "): \t"
+  result = quote do:
+    `prefix` & `a`.type.name
+
+echo gt2(Foo) # Foo  shouldn't this be typeDesc[Foo] ?
+echo gt2(Bar) # Bar  shouldn't this be typeDesc[Bar] ?
+echo gt2(Baz) # Baz  shouldn't this be typeDesc[Baz] ?
+echo gt2(foo) # Foo
+echo gt2(bar) # Bar
+echo gt2(baz) # Baz
+
+echo gt2(v)   # seq[int]
+echo gt2(vv)  # seq[float]
+echo gt2(t)   # MyType[system.int]      why is it system.int and not just int like in seq?
+echo gt2(tt)  # MyType[system.float]    why is it system.float and not just float like in seq?
+echo gt2(s)   # MySimpleType
diff --git a/tests/metatype/twildtypedesc.nim b/tests/metatype/twildtypedesc.nim
new file mode 100644
index 000000000..268bff0d8
--- /dev/null
+++ b/tests/metatype/twildtypedesc.nim
@@ -0,0 +1,43 @@
+discard """
+  output: '''123
+123
+123
+123
+123
+123'''
+"""
+
+import strutils
+
+proc unpack(t: typedesc[string], v: string): string = $v
+proc unpack(t: typedesc[int], v: string): int = parseInt(v)
+
+proc unpack[T](v: string): T =
+  unpack T, v
+
+var s = "123"
+
+assert(unpack[string](s) is string)
+assert(unpack[int](s) is int)
+
+echo unpack[int](s)
+echo unpack[string](s)
+
+echo unpack(int,s)
+echo unpack(string,s)
+
+template `as`*(x: untyped, t: typedesc): untyped = unpack(t,x)
+
+echo s as int
+echo s as string
+
+# bug #4534
+
+proc unit(t: typedesc[int]): t = 0
+proc unit(t: typedesc[string]): t = ""
+proc unit(t: typedesc[float]): t = 0.0
+
+assert unit(int) == 0
+assert unit(string) == ""
+assert unit(float) == 0.0
+
diff --git a/tests/stdlib/tnet_ll.nim b/tests/stdlib/tnet_ll.nim
index 4d4df7c13..2ac272fd1 100644
--- a/tests/stdlib/tnet_ll.nim
+++ b/tests/stdlib/tnet_ll.nim
@@ -1,5 +1,8 @@
 discard """

   action: run

+  output: '''

+[Suite] inet_ntop tests

+'''

 """

 

 when defined(windows):

diff --git a/tests/stdlib/tparseuints.nim b/tests/stdlib/tparseuints.nim
index 5be3bcbd0..6b228d933 100644
--- a/tests/stdlib/tparseuints.nim
+++ b/tests/stdlib/tparseuints.nim
@@ -1,5 +1,7 @@
 discard """
   action: run
+  output: '''
+[Suite] parseutils'''
 """
 import unittest, strutils
 
diff --git a/tests/stdlib/ttime.nim b/tests/stdlib/ttime.nim
index ac37196fb..3ab287c4e 100644
--- a/tests/stdlib/ttime.nim
+++ b/tests/stdlib/ttime.nim
@@ -39,55 +39,49 @@ doAssert t4.format("M MM MMM MMMM") == "10 10 Oct October"
 doAssert((t4 - initInterval(years = 2)).format("yyyy") == "1995")
 doAssert((t4 - initInterval(years = 7, minutes = 34, seconds = 24)).format("yyyy mm ss") == "1990 24 10")
 
-var s = "Tuesday at 09:04am on Dec 15, 2015"
-var f = "dddd at hh:mmtt on MMM d, yyyy"
-doAssert($s.parse(f) == "Tue Dec 15 09:04:00 2015")
+proc parseTest(s, f, sExpected: string, ydExpected: int) =
+  let parsed = s.parse(f)
+  doAssert($parsed == sExpected)
+  doAssert(parsed.yearday == ydExpected)
+proc parseTestTimeOnly(s, f, sExpected: string) =
+  doAssert(sExpected in $s.parse(f))
+
+parseTest("Tuesday at 09:04am on Dec 15, 2015",
+    "dddd at hh:mmtt on MMM d, yyyy", "Tue Dec 15 09:04:00 2015", 348)
 # ANSIC       = "Mon Jan _2 15:04:05 2006"
-s = "Thu Jan 12 15:04:05 2006"
-f = "ddd MMM dd HH:mm:ss yyyy"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
+parseTest("Thu Jan 12 15:04:05 2006", "ddd MMM dd HH:mm:ss yyyy",
+    "Thu Jan 12 15:04:05 2006", 11)
 # UnixDate    = "Mon Jan _2 15:04:05 MST 2006"
-s = "Thu Jan 12 15:04:05 MST 2006"
-f = "ddd MMM dd HH:mm:ss ZZZ yyyy"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
+parseTest("Thu Jan 12 15:04:05 MST 2006", "ddd MMM dd HH:mm:ss ZZZ yyyy",
+    "Thu Jan 12 15:04:05 2006", 11)
 # RubyDate    = "Mon Jan 02 15:04:05 -0700 2006"
-s = "Thu Jan 12 15:04:05 -07:00 2006"
-f = "ddd MMM dd HH:mm:ss zzz yyyy"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
+parseTest("Mon Feb 29 15:04:05 -07:00 2016", "ddd MMM dd HH:mm:ss zzz yyyy",
+    "Mon Feb 29 15:04:05 2016", 59) # leap day
 # RFC822      = "02 Jan 06 15:04 MST"
-s = "12 Jan 16 15:04 MST"
-f = "dd MMM yy HH:mm ZZZ"
-doAssert($s.parse(f) == "Tue Jan 12 15:04:00 2016")
+parseTest("12 Jan 16 15:04 MST", "dd MMM yy HH:mm ZZZ",
+    "Tue Jan 12 15:04:00 2016", 11)
 # RFC822Z     = "02 Jan 06 15:04 -0700" # RFC822 with numeric zone
-s = "12 Jan 16 15:04 -07:00"
-f = "dd MMM yy HH:mm zzz"
-doAssert($s.parse(f) == "Tue Jan 12 15:04:00 2016")
+parseTest("01 Mar 16 15:04 -07:00", "dd MMM yy HH:mm zzz",
+    "Tue Mar  1 15:04:00 2016", 60) # day after february in leap year
 # RFC850      = "Monday, 02-Jan-06 15:04:05 MST"
-s = "Monday, 12-Jan-06 15:04:05 MST"
-f = "dddd, dd-MMM-yy HH:mm:ss ZZZ"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
+parseTest("Monday, 12-Jan-06 15:04:05 MST", "dddd, dd-MMM-yy HH:mm:ss ZZZ",
+    "Thu Jan 12 15:04:05 2006", 11)
 # RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
-s = "Thu, 12 Jan 2006 15:04:05 MST"
-f = "ddd, dd MMM yyyy HH:mm:ss ZZZ"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
+parseTest("Sun, 01 Mar 2015 15:04:05 MST", "ddd, dd MMM yyyy HH:mm:ss ZZZ",
+    "Sun Mar  1 15:04:05 2015", 59) # day after february in non-leap year
 # RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700" # RFC1123 with numeric zone
-s = "Thu, 12 Jan 2006 15:04:05 -07:00"
-f = "ddd, dd MMM yyyy HH:mm:ss zzz"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
+parseTest("Thu, 12 Jan 2006 15:04:05 -07:00", "ddd, dd MMM yyyy HH:mm:ss zzz",
+    "Thu Jan 12 15:04:05 2006", 11)
 # RFC3339     = "2006-01-02T15:04:05Z07:00"
-s = "2006-01-12T15:04:05Z-07:00"
-f = "yyyy-MM-ddTHH:mm:ssZzzz"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
-f = "yyyy-MM-dd'T'HH:mm:ss'Z'zzz"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
+parseTest("2006-01-12T15:04:05Z-07:00", "yyyy-MM-ddTHH:mm:ssZzzz",
+    "Thu Jan 12 15:04:05 2006", 11)
+parseTest("2006-01-12T15:04:05Z-07:00", "yyyy-MM-dd'T'HH:mm:ss'Z'zzz",
+    "Thu Jan 12 15:04:05 2006", 11)
 # RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
-s = "2006-01-12T15:04:05.999999999Z-07:00"
-f = "yyyy-MM-ddTHH:mm:ss.999999999Zzzz"
-doAssert($s.parse(f) == "Thu Jan 12 15:04:05 2006")
+parseTest("2006-01-12T15:04:05.999999999Z-07:00",
+    "yyyy-MM-ddTHH:mm:ss.999999999Zzzz", "Thu Jan 12 15:04:05 2006", 11)
 # Kitchen     = "3:04PM"
-s = "3:04PM"
-f = "h:mmtt"
-doAssert "15:04:00" in $s.parse(f)
+parseTestTimeOnly("3:04PM", "h:mmtt", "15:04:00")
 #when not defined(testing):
 #  echo "Kitchen: " & $s.parse(f)
 #  var ti = timeToTimeInfo(getTime())
diff --git a/tests/template/ttemp_in_varargs.nim b/tests/template/ttemp_in_varargs.nim
new file mode 100644
index 000000000..be78e6ef2
--- /dev/null
+++ b/tests/template/ttemp_in_varargs.nim
@@ -0,0 +1,9 @@
+discard """
+  output: '''a'''
+"""
+
+# bug #4292
+
+template foo(s: string): string = s
+proc variadicProc*(v: varargs[string, foo]) = echo v[0]
+variadicProc("a")
diff --git a/tests/vm/tconst_float_as_int.nim b/tests/vm/tconst_float_as_int.nim
new file mode 100644
index 000000000..ed84ec194
--- /dev/null
+++ b/tests/vm/tconst_float_as_int.nim
@@ -0,0 +1,3 @@
+
+# bug #4619
+const x: float = 0