diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-12-29 20:25:05 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-12-29 20:25:05 +0100 |
commit | bbb5ce38c765c73a489e15d2a91c322fd2ff213b (patch) | |
tree | 4be2dffabc1fb361d239b1331ed93bb02c04f709 /tests/closure | |
parent | e079db95f8ee59b6475fbe1c59dc667caf7a423c (diff) | |
download | Nim-bbb5ce38c765c73a489e15d2a91c322fd2ff213b.tar.gz |
updated test cases
Diffstat (limited to 'tests/closure')
-rw-r--r-- | tests/closure/tclosurebug2.nim | 6 | ||||
-rw-r--r-- | tests/closure/tnestedclosure.nim | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/closure/tclosurebug2.nim b/tests/closure/tclosurebug2.nim index 581b735bf..f131406a3 100644 --- a/tests/closure/tclosurebug2.nim +++ b/tests/closure/tclosurebug2.nim @@ -19,11 +19,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() {.dirty.} = - 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 @@ -31,7 +31,7 @@ template rawGetImpl() {.dirty.} = result = -1 template rawInsertImpl() {.dirty.} = - 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 diff --git a/tests/closure/tnestedclosure.nim b/tests/closure/tnestedclosure.nim index 67e196f66..0628a6977 100644 --- a/tests/closure/tnestedclosure.nim +++ b/tests/closure/tnestedclosure.nim @@ -21,13 +21,13 @@ proc main(param: int) = # test simple closure within dummy 'main': proc dummy = proc main2(param: int) = - var foo = 23 + var fooB = 23 proc outer(outerParam: string) = var outerVar = 88 echo outerParam, outerVar proc inner() = block Test: - echo foo, " ", param, outerParam, " ", outerVar + echo fooB, " ", param, outerParam, " ", outerVar inner() outer("foo") main2(24) |