diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/async/tasyncawait.nim | 12 | ||||
-rw-r--r-- | tests/collections/thashes.nim | 4 | ||||
-rw-r--r-- | tests/exprs/tstmtexprs.nim | 2 | ||||
-rw-r--r-- | tests/misc/tsimplesort.nim | 10 | ||||
-rw-r--r-- | tests/trmacros/thoist.nim | 2 | ||||
-rw-r--r-- | tests/typerel/texplicitcmp.nim | 4 |
6 files changed, 17 insertions, 17 deletions
diff --git a/tests/async/tasyncawait.nim b/tests/async/tasyncawait.nim index 9fe9507ad..74933f063 100644 --- a/tests/async/tasyncawait.nim +++ b/tests/async/tasyncawait.nim @@ -12,11 +12,11 @@ const var clientCount = 0 -proc sendMessages(client: TAsyncFD) {.async.} = +proc sendMessages(client: AsyncFD) {.async.} = for i in 0 .. <messagesToSend: await send(client, "Message " & $i & "\c\L") -proc launchSwarm(port: TPort) {.async.} = +proc launchSwarm(port: Port) {.async.} = for i in 0 .. <swarmSize: var sock = newAsyncNativeSocket() @@ -24,7 +24,7 @@ proc launchSwarm(port: TPort) {.async.} = await sendMessages(sock) closeSocket(sock) -proc readMessages(client: TAsyncFD) {.async.} = +proc readMessages(client: AsyncFD) {.async.} = while true: var line = await recvLine(client) if line == "": @@ -37,7 +37,7 @@ proc readMessages(client: TAsyncFD) {.async.} = else: doAssert false -proc createServer(port: TPort) {.async.} = +proc createServer(port: Port) {.async.} = var server = newAsyncNativeSocket() block: var name: Sockaddr_in @@ -55,8 +55,8 @@ proc createServer(port: TPort) {.async.} = while true: asyncCheck readMessages(await accept(server)) -asyncCheck createServer(TPort(10335)) -asyncCheck launchSwarm(TPort(10335)) +asyncCheck createServer(Port(10335)) +asyncCheck launchSwarm(Port(10335)) while true: poll() if clientCount == swarmSize: break diff --git a/tests/collections/thashes.nim b/tests/collections/thashes.nim index 76b99313c..5cc3cc8bb 100644 --- a/tests/collections/thashes.nim +++ b/tests/collections/thashes.nim @@ -3,7 +3,7 @@ discard """ """ import tables -from hashes import THash +from hashes import Hash # Test with int block: @@ -66,7 +66,7 @@ block: # The same test with a custom hash(s: string) does # work though. block: - proc hash(x: int): THash {.inline.} = + proc hash(x: int): Hash {.inline.} = echo "overloaded hash" result = x var t = initTable[int, int]() diff --git a/tests/exprs/tstmtexprs.nim b/tests/exprs/tstmtexprs.nim index 2a0ec2821..577f314ec 100644 --- a/tests/exprs/tstmtexprs.nim +++ b/tests/exprs/tstmtexprs.nim @@ -81,7 +81,7 @@ semiProblem() # bug #844 import json -proc parseResponse(): PJsonNode = +proc parseResponse(): JsonNode = result = % { "key1": % { "key2": % "value" } } for key, val in result["key1"]: var excMsg = key & "(" diff --git a/tests/misc/tsimplesort.nim b/tests/misc/tsimplesort.nim index 3115863d5..e4a8e0b37 100644 --- a/tests/misc/tsimplesort.nim +++ b/tests/misc/tsimplesort.nim @@ -40,11 +40,11 @@ proc mustRehash(length, counter: int): bool {.inline.} = assert(length > counter) result = (length * 2 < counter * 3) or (length - counter < 4) -proc nextTry(h, maxHash: THash): THash {.inline.} = +proc nextTry(h, maxHash: Hash): Hash {.inline.} = result = ((5 * h) + 1) and maxHash template rawGetImpl() = - var h: THash = hash(key) and high(t.data) # start with real hash value + var h: Hash = hash(key) and high(t.data) # start with real hash value while t.data[h].slot != seEmpty: if t.data[h].key == key and t.data[h].slot == seFilled: return h @@ -52,7 +52,7 @@ template rawGetImpl() = result = -1 template rawInsertImpl() = - var h: THash = hash(key) and high(data) + var h: Hash = hash(key) and high(data) while data[h].slot == seFilled: h = nextTry(h, high(data)) data[h].key = key @@ -162,7 +162,7 @@ iterator values*[A](t: TCountTable[A]): int = if t.data[h].val != 0: yield t.data[h].val proc RawGet[A](t: TCountTable[A], key: A): int = - var h: THash = hash(key) and high(t.data) # start with real hash value + var h: Hash = hash(key) and high(t.data) # start with real hash value while t.data[h].val != 0: if t.data[h].key == key: return h h = nextTry(h, high(t.data)) @@ -181,7 +181,7 @@ proc hasKey*[A](t: TCountTable[A], key: A): bool = proc rawInsert[A](t: TCountTable[A], data: var seq[tuple[key: A, val: int]], key: A, val: int) = - var h: THash = hash(key) and high(data) + var h: Hash = hash(key) and high(data) while data[h].val != 0: h = nextTry(h, high(data)) data[h].key = key data[h].val = val diff --git a/tests/trmacros/thoist.nim b/tests/trmacros/thoist.nim index 7d14c0abf..657f210a1 100644 --- a/tests/trmacros/thoist.nim +++ b/tests/trmacros/thoist.nim @@ -5,7 +5,7 @@ true''' import pegs -template optPeg{peg(pattern)}(pattern: string{lit}): TPeg = +template optPeg{peg(pattern)}(pattern: string{lit}): Peg = var gl {.global, gensym.} = peg(pattern) gl diff --git a/tests/typerel/texplicitcmp.nim b/tests/typerel/texplicitcmp.nim index 8aec9885a..e91ac2ffe 100644 --- a/tests/typerel/texplicitcmp.nim +++ b/tests/typerel/texplicitcmp.nim @@ -18,7 +18,7 @@ proc works() = sort(f, system.cmp[int]) outp(f) -proc weird(json_params: TTable) = +proc weird(json_params: Table) = var f = @[3, 2, 1] # The following line doesn't compile: type mismatch. Why? sort(f, system.cmp[int]) @@ -29,4 +29,4 @@ when isMainModule: sort(t, system.cmp[int]) outp(t) works() - weird(initTable[string, TJsonNode]()) + weird(initTable[string, JsonNode]()) |