Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for PanicNilError (0.09 sec)

  1. src/runtime/panicnil_test.go

    	"runtime/metrics"
    	"testing"
    )
    
    func TestPanicNil(t *testing.T) {
    	t.Run("default", func(t *testing.T) {
    		checkPanicNil(t, new(runtime.PanicNilError))
    	})
    	t.Run("GODEBUG=panicnil=0", func(t *testing.T) {
    		t.Setenv("GODEBUG", "panicnil=0")
    		checkPanicNil(t, new(runtime.PanicNilError))
    	})
    	t.Run("GODEBUG=panicnil=1", func(t *testing.T) {
    		t.Setenv("GODEBUG", "panicnil=1")
    		checkPanicNil(t, nil)
    	})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 19 22:26:43 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  2. src/sync/oncefunc_test.go

    	calls := 0
    	f := sync.OnceFunc(func() {
    		calls++
    		panic(nil)
    	})
    	testOncePanicWith(t, &calls, f, func(label string, p any) {
    		switch p.(type) {
    		case nil, *runtime.PanicNilError:
    			return
    		}
    		t.Fatalf("%s: want nil panic, got %v", label, p)
    	})
    }
    
    func TestOnceFuncGoexit(t *testing.T) {
    	// If f calls Goexit, the results are unspecified. But check that f doesn't
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 17:31:33 UTC 2023
    - 6.9K bytes
    - Viewed (0)
Back to top