Merge pull request #600 from duglin/FixTest

Fix to allow for build in different path
This commit is contained in:
Mrunal Patel 2016-02-29 11:01:31 -08:00
commit 5f8fd8e04e
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,9 @@
package stacktrace
import "testing"
import (
"strings"
"testing"
)
func captureFunc() Stacktrace {
return Capture(0)
@ -18,7 +21,8 @@ func TestCaptureTestFunc(t *testing.T) {
if expected := "captureFunc"; frame.Function != expected {
t.Fatalf("expteced function %q but recevied %q", expected, frame.Function)
}
if expected := "github.com/opencontainers/runc/libcontainer/stacktrace"; frame.Package != expected {
expected := "github.com/opencontainers/runc/libcontainer/stacktrace"
if !strings.HasSuffix(frame.Package, expected) {
t.Fatalf("expected package %q but received %q", expected, frame.Package)
}
if expected := "capture_test.go"; frame.File != expected {