mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-05-11 06:59:17 -04:00
Feat: core.ToContext(ctx, v) for ctx initialization (#852)
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
. "github.com/v2fly/v2ray-core/v4"
|
||||
)
|
||||
|
||||
func TestContextPanic(t *testing.T) {
|
||||
func TestFromContextPanic(t *testing.T) {
|
||||
defer func() {
|
||||
r := recover()
|
||||
if r == nil {
|
||||
@@ -17,3 +17,14 @@ func TestContextPanic(t *testing.T) {
|
||||
|
||||
MustFromContext(context.Background())
|
||||
}
|
||||
|
||||
func TestToContextPanic(t *testing.T) {
|
||||
defer func() {
|
||||
r := recover()
|
||||
if r == nil {
|
||||
t.Error("expect panic, but nil")
|
||||
}
|
||||
}()
|
||||
|
||||
MustToContext(context.Background(), &Instance{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user