- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for expectPanic (0.17 sec)
-
pkg/proxy/node_test.go
ResourceVersion: "1", }, Spec: v1.NodeSpec{ PodCIDRs: tt.newNodePodCIDRs, }, } defer func() { r := recover() if r == nil && tt.expectPanic { t.Errorf("The code did not panic") } else if r != nil && !tt.expectPanic { t.Errorf("The code did panic") } }() n.OnNodeAdd(node) }) } } func TestNodePodCIDRHandlerUpdate(t *testing.T) {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sun Sep 10 16:50:29 UTC 2023 - 3.5K bytes - Viewed (0) -
test/method.go
func (D) h() {} // value receiver, indirect field of A func (*D) i() {} // pointer receiver func expectPanic() { if r := recover(); r == nil { panic("expected nil dereference") } } func promotion() { var a A // Addressable value receiver. a.f() a.g() func() { defer expectPanic() a.h() // dynamic error: nil dereference in a.B.D->f() }() a.i()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 11 23:20:52 UTC 2013 - 5.2K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured_conversion_test.go
scheme, _ := test.TestScheme() testCases := []struct { name string unstructuredToConvert *unstructured.Unstructured convertingObject runtime.Object expectPanic bool expectedErrFunc func(err error) bool expectedConvertedObject runtime.Object }{ { name: "convert empty unstructured w/o gvk to versioned object should fail",
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Apr 07 15:19:26 UTC 2020 - 16.4K bytes - Viewed (0) -
src/syscall/js/js_test.go
t.Errorf("got %#v, want %#v", got, 42) } if got := dummys.Call("add", js.Global().Call("eval", "40"), 2).Int(); got != 42 { t.Errorf("got %#v, want %#v", got, 42) } expectPanic(t, func() { dummys.Call("zero") }) expectValueError(t, func() { dummys.Get("zero").Call("badMethod") }) } func TestInvoke(t *testing.T) { var i int64 = 40
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 19 14:35:26 UTC 2024 - 17.7K bytes - Viewed (0) -
src/database/sql/sql_test.go
if err != nil { t.Fatalf("Open: %v", err) } expectPanic := func(name string, f func()) { defer func() { err := recover() if err == nil { t.Fatalf("%s did not panic", name) } }() f() } expectPanic("Exec Exec", func() { db.Exec("PANIC|Exec|WIPE") }) exec(t, db, "WIPE") // check not deadlocked expectPanic("Exec NumInput", func() { db.Exec("PANIC|NumInput|WIPE") })
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 18:42:28 UTC 2024 - 111.6K bytes - Viewed (0)