]> 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)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 26 Apr 2019 16:41:56 +0000 (16:41 +0000)
commita1a9d8a84d4924cb2d374b33cb5844b2e43c6fe9
tree5109a8baa8cdbb3e31daab75c8b12b73dcb96a07
parentf1a077df1028bea7285bd790395524db22ec8597
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>
(cherry picked from commit d13a9312f52a3e861e02aff8ccb3f237b45b0822)
Reviewed-on: https://go-review.googlesource.com/c/go/+/173940
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/export_test.go
src/runtime/mgclarge.go
src/runtime/treap_test.go [new file with mode: 0644]