topenlen.nim 344 B

12345678910111213141516
  1. discard """
  2. output: "7"
  3. """
  4. # Tests a special bug
  5. proc choose(b: openArray[string]): string = return b[0]
  6. proc p(a, b: openArray[string]): int =
  7. result = a.len + b.len - 1
  8. for j in 0 .. a.len: inc(result)
  9. discard choose(a)
  10. discard choose(b)
  11. discard choose(["sh", "-c", $p([""], ["a"])])
  12. echo($p(["", "ha", "abc"], ["xyz"])) #OUT 7