Remove testutils (#13435) [backport]

This commit is contained in:
Clyybber 2020-02-19 23:02:08 +01:00 • committed by GitHub
commit 87dd19453b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 20 deletions

View file

@ -776,11 +776,12 @@ iterator allValues*[A, B](t: Table[A, B]; key: A): B =
## `add proc<#add,Table[A,B],A,B>`_).
##
runnableExamples:
import testutils
import sequtils, algorithm
var a = {'a': 3, 'b': 5}.toTable
for i in 1..3: a.add('z', 10*i)
doAssert a.sortedPairs == @[('a', 3), ('b', 5), ('z', 10), ('z', 20), ('z', 30)]
doAssert sortedItems(a.allValues('z')) == @[10, 20, 30]
doAssert toSeq(a.pairs).sorted == @[('a', 3), ('b', 5), ('z', 10), ('z', 20), ('z', 30)]
doAssert sorted(toSeq(a.allValues('z'))) == @[10, 20, 30]
let hc = genHash(key)
var h: Hash = hc and high(t.data)