summary refs log tree commit diff stats
path: root/tests/stdlib/tvarargs.nim
blob: 2edc26264aae0ae74df6ab1f72d8c28de9be891a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
  targets: "c js"
  matrix: "--mm:refc; --mm:orc"
"""
import std/assertions

template main =
  proc hello(x: varargs[string]): seq[string] =
    var s: seq[string]
    s.add x
    s

  doAssert hello() == @[]
  doAssert hello("a1") == @["a1"]
  doAssert hello("a1", "a2") == @["a1", "a2"]

static: main()
main()