update vendor
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
7a437ada25
commit
639756e8c6
4300 changed files with 824810 additions and 9292 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("expected function %q but recevied %q", expected, frame.Function)
|
||||
}
|
||||
expected := "/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)
|
||||
}
|
||||
}
|
20
vendor/github.com/opencontainers/runc/libcontainer/stacktrace/frame_test.go
generated
vendored
Normal file
20
vendor/github.com/opencontainers/runc/libcontainer/stacktrace/frame_test.go
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
package stacktrace
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParsePackageName(t *testing.T) {
|
||||
var (
|
||||
name = "github.com/opencontainers/runc/libcontainer/stacktrace.captureFunc"
|
||||
expectedPackage = "github.com/opencontainers/runc/libcontainer/stacktrace"
|
||||
expectedFunction = "captureFunc"
|
||||
)
|
||||
|
||||
pack, funcName := parseFunctionName(name)
|
||||
if pack != expectedPackage {
|
||||
t.Fatalf("expected package %q but received %q", expectedPackage, pack)
|
||||
}
|
||||
|
||||
if funcName != expectedFunction {
|
||||
t.Fatalf("expected function %q but received %q", expectedFunction, funcName)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue