Don't run non-test code when defined(testing)
This commit is contained in:
parent
d203d6fad4
commit
32109a7867
46 changed files with 104 additions and 82 deletions
|
|
@ -300,7 +300,7 @@ proc newAsyncFtpClient*(address: string, port = Port(21),
|
|||
result.dsockConnected = false
|
||||
result.csock = newAsyncSocket()
|
||||
|
||||
when isMainModule:
|
||||
when not defined(testing) and isMainModule:
|
||||
var ftp = newAsyncFtpClient("example.com", user = "test", pass = "test")
|
||||
proc main(ftp: AsyncFtpClient) {.async.} =
|
||||
await ftp.connect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue