mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 06:45:27 +00:00
updated tests to be executed
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
discard """
|
||||
output: '''
|
||||
Test
|
||||
abcxyz123
|
||||
'''
|
||||
"""
|
||||
|
||||
proc fakeReadLine(): string =
|
||||
"abcxyz123"
|
||||
|
||||
type
|
||||
TMaybe[T] = object
|
||||
case empty: bool
|
||||
@@ -12,7 +22,7 @@ proc Nothing[T](): TMaybe[T] =
|
||||
result.empty = true
|
||||
|
||||
proc safeReadLine(): TMaybe[string] =
|
||||
var r = stdin.readLine()
|
||||
var r = fakeReadLine()
|
||||
if r == "": return Nothing[string]()
|
||||
else: return Just(r)
|
||||
|
||||
@@ -21,3 +31,4 @@ when isMainModule:
|
||||
echo(Test.value)
|
||||
var mSomething = safeReadLine()
|
||||
echo(mSomething.value)
|
||||
mSomething = safeReadLine()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
discard """
|
||||
cmd: "nim $target --hints:on --threads:on $options $file"
|
||||
action: compile
|
||||
"""
|
||||
|
||||
type
|
||||
@@ -36,4 +37,3 @@ when isMainModule:
|
||||
echo("test")
|
||||
joinThread(thr)
|
||||
os.sleep(3000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user