Files
Nim/tests/niminaction/Chapter2/resultaccept.nim
Timothee Cour 6c5872c169 --nilseqs is now a deprecated noop (#17211)
* --nilseqs is now a deprecated noop

* fix tests; fix: future => sugar
2021-03-01 20:59:43 +01:00

28 lines
571 B
Nim

discard """
output: ""
"""
# Page 35.
proc implicit: string =
"I will be returned"
proc discarded: string =
discard "I will not be returned"
proc explicit: string =
return "I will be returned"
proc resultVar: string =
result = "I will be returned"
proc resultVar2: string =
result = ""
result.add("I will be ")
result.add("returned")
doAssert implicit() == "I will be returned"
doAssert discarded().len == 0
doAssert explicit() == "I will be returned"
doAssert resultVar() == "I will be returned"
doAssert resultVar2() == "I will be returned"