mirror of
https://github.com/genuinetools/reg.git
synced 2024-08-22 14:40:22 -04:00
21 lines
563 B
Go
21 lines
563 B
Go
![]() |
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)
|
||
|
}
|
||
|
}
|