]> Cypherpunks repositories - gostls13.git/commitdiff
container/heap: fix circular dependency in test
authorDavid Symonds <dsymonds@golang.org>
Fri, 22 Apr 2011 20:29:05 +0000 (16:29 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 22 Apr 2011 20:29:05 +0000 (16:29 -0400)
Having the test be in the container/heap package yields a cycle
  container/heap (for the test)
  -> testing
  -> time
  -> container/heap (for timerHeap)

Occasionally the linker would get mixed up, resulting in a test panic
in a very weird place.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4395042

src/pkg/container/heap/heap_test.go

index 89d444dd54655ca683b126e417cc1591d62ad5ff..5eb54374ab297d32aa5016f5aa5a73d4bc85bc84 100644 (file)
@@ -2,11 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package heap
+package heap_test
 
 import (
        "testing"
        "container/vector"
+       . "container/heap"
 )