summary refs log blame commit diff stats
path: root/tests/accept/run/topenlen.nim
blob: fec8e87b7bad38db460c14b17b8014aabc0125f1 (plain) (tree)
1
2
3
4



                      











                                                       

 
discard """
  file: "topenlen.nim"
  output: "7"
"""
# Tests a special bug

proc choose(b: openArray[string]): string = return b[0]

proc p(a, b: openarray[string]): int =
  result = a.len + b.len - 1
  for j in 0 .. a.len: inc(result)
  discard choose(a)
  discard choose(b)

discard choose(["sh", "-c", $p([""], ["a"])])
echo($p(["", "ha", "abc"], ["xyz"])) #OUT 7