Switch to new vendor directory layout
Fixes #113 Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
parent
bc6adb7e4d
commit
d5742209d3
806 changed files with 2 additions and 7 deletions
31
vendor/github.com/opencontainers/runc/libcontainer/stacktrace/capture_test.go
generated
vendored
Normal file
31
vendor/github.com/opencontainers/runc/libcontainer/stacktrace/capture_test.go
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
package stacktrace
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func captureFunc() Stacktrace {
|
||||
return Capture(0)
|
||||
}
|
||||
|
||||
func TestCaptureTestFunc(t *testing.T) {
|
||||
stack := captureFunc()
|
||||
|
||||
if len(stack.Frames) == 0 {
|
||||
t.Fatal("expected stack frames to be returned")
|
||||
}
|
||||
|
||||
// the first frame is the caller
|
||||
frame := stack.Frames[0]
|
||||
if expected := "captureFunc"; frame.Function != expected {
|
||||
t.Fatalf("expteced function %q but recevied %q", expected, frame.Function)
|
||||
}
|
||||
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 {
|
||||
t.Fatalf("expected file %q but received %q", expected, frame.File)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue