diff options
author | narimiran <narimiran@disroot.org> | 2019-03-03 10:53:37 +0100 |
---|---|---|
committer | narimiran <narimiran@disroot.org> | 2019-03-03 10:53:37 +0100 |
commit | 792dfac521ce871019676fa17aed1cf8596d8127 (patch) | |
tree | cb84a9f02321e1df66917102464334fec68ff84b /lib/pure | |
parent | d6882691ad957b132728cc3c801d07fae0f92f59 (diff) | |
download | Nim-792dfac521ce871019676fa17aed1cf8596d8127.tar.gz |
hashes: fix inconsistent tests, fixes #10771
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/hashes.nim | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim index a08a583c0..5bc9dac3c 100644 --- a/lib/pure/hashes.nim +++ b/lib/pure/hashes.nim @@ -143,8 +143,7 @@ proc hash*(x: string): Hash = ## * `hashIgnoreStyle <#hashIgnoreStyle,string>`_ ## * `hashIgnoreCase <#hashIgnoreCase,string>`_ runnableExamples: - doAssert hash("abracadabra") == -5600162842546114722 - doAssert hash("Abracadabra") == 2068684413884279454 + doAssert hash("abracadabra") != hash("AbracadabrA") var h: Hash = 0 for i in 0..x.len-1: @@ -154,8 +153,8 @@ proc hash*(x: string): Hash = proc hash*(x: cstring): Hash = ## Efficient hashing of null-terminated strings. runnableExamples: - doAssert hash(cstring"abracadabra") == -5600162842546114722 - doAssert hash(cstring"Abracadabra") == 2068684413884279454 + doAssert hash(cstring"abracadabra") == hash("abracadabra") + doAssert hash(cstring"AbracadabrA") == hash("AbracadabrA") var h: Hash = 0 var i = 0 |