]> Cypherpunks repositories - gostls13.git/commit
runtime: add tests for runtime mTreap
authorMichael Anthony Knyszek <mknyszek@google.com>
Sat, 9 Feb 2019 00:13:37 +0000 (00:13 +0000)
committerMichael Knyszek <mknyszek@google.com>
Wed, 10 Apr 2019 22:00:53 +0000 (22:00 +0000)
commitd13a9312f52a3e861e02aff8ccb3f237b45b0822
tree18e29d4910331971f2b0c518d37dcf4e61ba81f5
parent2ab6d0172eb9112eba8c6e05a813e260985d20cf
runtime: add tests for runtime mTreap

This change exports the runtime mTreap in export_test.go and then adds a
series of tests which check that the invariants of the treap are
maintained under different operations. These tests also include tests
for the treap iterator type.

Also, we note that the find() operation on the treap never actually was
best-fit, so the tests just ensure that it returns an appropriately
sized span.

For #30333.

Change-Id: If81f7c746dda6677ebca925cb0a940134701b894
Reviewed-on: https://go-review.googlesource.com/c/go/+/164100
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/export_test.go
src/runtime/mgclarge.go
src/runtime/treap_test.go [new file with mode: 0644]