Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for shouldPanic (0.18 sec)

  1. src/reflect/all_test.go

    	xa := [8]int{10, 20, 30, 40, 50, 60, 70, 80}
    
    	vs := ValueOf(&xs).Elem()
    	shouldPanic("SetLen", func() { vs.SetLen(10) })
    	shouldPanic("SetCap", func() { vs.SetCap(10) })
    	shouldPanic("SetLen", func() { vs.SetLen(-1) })
    	shouldPanic("SetCap", func() { vs.SetCap(-1) })
    	shouldPanic("SetCap", func() { vs.SetCap(6) }) // smaller than len
    	vs.SetLen(5)
    	if len(xs) != 5 || cap(xs) != 8 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
  2. src/slices/slices_test.go

    	cases := []struct {
    		lengths     []int
    		shouldPanic bool
    	}{
    		{
    			lengths:     []int{0, 0},
    			shouldPanic: false,
    		},
    		{
    			lengths:     []int{math.MaxInt, 0},
    			shouldPanic: false,
    		},
    		{
    			lengths:     []int{0, math.MaxInt},
    			shouldPanic: false,
    		},
    		{
    			lengths:     []int{math.MaxInt - 1, 1},
    			shouldPanic: false,
    		},
    		{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:06 UTC 2024
    - 33.2K bytes
    - Viewed (0)
  3. src/reflect/type_test.go

    			Name:      "Named",
    			Type:      reflect.TypeFor[Named](),
    		},
    	})
    
    	v := reflect.New(typ).Elem()
    	v.Field(0).Set(
    		reflect.ValueOf(reflect.TypeFor[string]()),
    	)
    
    	x := v.Interface().(Named)
    	shouldPanic("StructOf does not support methods of embedded interfaces", func() {
    		_ = x.Name()
    	})
    }
    
    func TestIsRegularMemory(t *testing.T) {
    	type args struct {
    		t reflect.Type
    	}
    	type S struct {
    		int
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  4. src/sync/atomic/atomic_test.go

    	p := (*uint64)(unsafe.Pointer(&x[1])) // misaligned
    
    	shouldPanic(t, "LoadUint64", func() { LoadUint64(p) })
    	shouldPanic(t, "LoadUint64Method", func() { (*Uint64)(unsafe.Pointer(p)).Load() })
    	shouldPanic(t, "StoreUint64", func() { StoreUint64(p, 1) })
    	shouldPanic(t, "StoreUint64Method", func() { (*Uint64)(unsafe.Pointer(p)).Store(1) })
    	shouldPanic(t, "CompareAndSwapUint64", func() { CompareAndSwapUint64(p, 1, 2) })
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:37:29 UTC 2024
    - 71.4K bytes
    - Viewed (0)
Back to top