diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-07-05 15:51:04 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-07-05 15:51:04 +0200 |
commit | 0926754e68861947c67986bc9c7e0a011a58267b (patch) | |
tree | bc11469a33f1aabd202e7105177553688439712a /tests/async | |
parent | 9b31f6785947974e89d46bbc0dee11f1c78754dc (diff) | |
download | Nim-0926754e68861947c67986bc9c7e0a011a58267b.tar.gz |
make tests green again
Diffstat (limited to 'tests/async')
-rw-r--r-- | tests/async/tasyncexceptions.nim | 2 | ||||
-rw-r--r-- | tests/async/tasynctry.nim | 14 | ||||
-rw-r--r-- | tests/async/twinasyncrw.nim | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/async/tasyncexceptions.nim b/tests/async/tasyncexceptions.nim index efe31ef27..7aa1d7fb0 100644 --- a/tests/async/tasyncexceptions.nim +++ b/tests/async/tasyncexceptions.nim @@ -20,7 +20,7 @@ proc processClient(fd: int) {.async.} = var line = await recvLine(fd) var foo = line[0] if foo == 'g': - raise newException(EBase, "foobar") + raise newException(Exception, "foobar") proc serve() {.async.} = diff --git a/tests/async/tasynctry.nim b/tests/async/tasynctry.nim index 6749aabbf..0fe9efdc1 100644 --- a/tests/async/tasynctry.nim +++ b/tests/async/tasynctry.nim @@ -15,7 +15,7 @@ import asyncdispatch, strutils proc foobar() {.async.} = if 5 == 5: - raise newException(EInvalidIndex, "Test") + raise newException(IndexError, "Test") proc catch() {.async.} = # TODO: Create a test for when exceptions are not caught. @@ -26,26 +26,26 @@ proc catch() {.async.} = try: await foobar() - except EInvalidIndex: + except IndexError: echo("Specific except") try: await foobar() - except OSError, EInvalidField, EInvalidIndex: + except OSError, FieldError, IndexError: echo("Multiple idents in except") try: await foobar() - except OSError, EInvalidField: + except OSError, FieldError: assert false - except EInvalidIndex: + except IndexError: echo("Multiple except branches") try: await foobar() - except EInvalidIndex: + except IndexError: echo("Multiple except branches 2") - except OSError, EInvalidField: + except OSError, FieldError: assert false waitFor catch() diff --git a/tests/async/twinasyncrw.nim b/tests/async/twinasyncrw.nim index 17b7d1cf5..42a7e3058 100644 --- a/tests/async/twinasyncrw.nim +++ b/tests/async/twinasyncrw.nim @@ -14,7 +14,7 @@ when defined(windows): var clientCount = 0 proc winConnect*(socket: AsyncFD, address: string, port: Port, - domain = Domain.AF_INET): Future[void] = + domain = Domain.AF_INET): Future[void] = var retFuture = newFuture[void]("winConnect") proc cb(fd: AsyncFD): bool = var ret = SocketHandle(fd).getSockOptInt(cint(SOL_SOCKET), cint(SO_ERROR)) @@ -183,7 +183,7 @@ when defined(windows): ## **Note**: This procedure is mostly used for testing. You likely want to ## use ``asyncnet.recvLine`` instead. - template addNLIfEmpty(): stmt = + template addNLIfEmpty() = if result.len == 0: result.add("\c\L") |