Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for TestPanic (0.23 sec)

  1. src/cmd/go/testdata/script/test_json_exit.txt

    # Test functions that panic should never be marked as passing
    # (https://golang.org/issue/40132).
    
    ! go test -json ./testpanic
    stdout '"Action":"fail"'
    ! stdout '"Action":"pass"'
    
    ! go tool test2json ./testpanic.exe -test.v
    stdout '"Action":"fail"'
    ! stdout '"Action":"pass"'
    
    ! go tool test2json ./testpanic.exe
    stdout '"Action":"fail"'
    ! stdout '"Action":"pass"'
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 17 19:43:21 UTC 2020
    - 2K bytes
    - Viewed (0)
  2. src/cmd/internal/test2json/testdata/panic.json

    {"Action":"start"}
    {"Action":"output","Test":"TestPanic","Output":"--- FAIL: TestPanic (0.00s)\n"}
    {"Action":"output","Test":"TestPanic","Output":"panic: oops [recovered]\n"}
    {"Action":"output","Test":"TestPanic","Output":"\tpanic: oops\n"}
    {"Action":"output","Test":"TestPanic","Output":"\n"}
    {"Action":"output","Test":"TestPanic","Output":"goroutine 7 [running]:\n"}
    {"Action":"output","Test":"TestPanic","Output":"testing.tRunner.func1(0xc000092100)\n"}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 09 17:33:07 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  3. src/cmd/internal/test2json/testdata/panic.test

    --- FAIL: TestPanic (0.00s)
    panic: oops [recovered]
    	panic: oops
    
    goroutine 7 [running]:
    testing.tRunner.func1(0xc000092100)
    	/go/src/testing/testing.go:874 +0x3a3
    panic(0x1110ea0, 0x116aea0)
    	/go/src/runtime/panic.go:679 +0x1b2
    command-line-arguments.TestPanic(0xc000092100)
    	a_test.go:6 +0x39
    testing.tRunner(0xc000092100, 0x114f500)
    	go/src/testing/testing.go:909 +0xc9
    created by testing.(*T).Run
    	go/src/testing/testing.go:960 +0x350
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 30 20:46:44 UTC 2019
    - 479 bytes
    - Viewed (0)
  4. test/chan/select3.go

    		nilch <- 7
    	})
    	testBlock(always, func() {
    		<-nilch
    	})
    
    	// sending/receiving from a nil channel inside a select is never selected
    	testPanic(never, func() {
    		select {
    		case nilch <- 7:
    			unreachable()
    		default:
    		}
    	})
    	testPanic(never, func() {
    		select {
    		case <-nilch:
    			unreachable()
    		default:
    		}
    	})
    
    	// sending to an async channel with free buffer space never blocks
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jul 08 02:10:12 UTC 2017
    - 4.1K bytes
    - Viewed (0)
  5. test/fixedbugs/issue56990.go

    }
    
    // Hack to run tests in a playground
    func matchString(a, b string) (bool, error) {
    	return a == b, nil
    }
    func main() {
    	testSuite := []testing.InternalTest{
    		{
    			Name: "TestPanic",
    			F:    TestPanic,
    		},
    	}
    	testing.Main(matchString, testSuite, nil, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 30 17:46:51 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  6. src/testing/panic_test.go

    )
    
    var testPanicTest = flag.String("test_panic_test", "", "TestPanic: indicates which test should panic")
    var testPanicParallel = flag.Bool("test_panic_parallel", false, "TestPanic: run subtests in parallel")
    var testPanicCleanup = flag.Bool("test_panic_cleanup", false, "TestPanic: indicates whether test should call Cleanup")
    var testPanicCleanupPanic = flag.String("test_panic_cleanup_panic", "", "TestPanic: indicate whether test should call Cleanup function that panics")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 27 16:49:24 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  7. src/cmd/go/testdata/script/test_json_panic_exit.txt

    package exit1_test
    
    import (
    	"os"
    	"testing"
    )
    
    func TestMain(m *testing.M) {
    	os.Exit(1)
    }
    
    -- panic/panic_test.go --
    package panic_test
    
    import "testing"
    
    func TestPanic(t *testing.T) {
    	panic("oh no")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 19:50:36 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  8. src/cmd/cover/testdata/test.go

    	testRange()
    	testSwitch()
    	testTypeSwitch()
    	testSelect1()
    	testSelect2()
    	testPanic()
    	testEmptySwitches()
    	testFunctionLiteral()
    	testGoto()
    }
    
    // The indexes of the counters in testPanic are known to main.go
    const panicIndex = 3
    
    // This test appears first because the index of its counters is known to main.go
    func testPanic() {
    	defer func() {
    		recover()
    	}()
    	check(LINE, 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 4.9K bytes
    - Viewed (0)
  9. src/cmd/cover/testdata/main.go

    		}
    	}
    	verifyPanic()
    	if !PASS {
    		fmt.Fprintf(os.Stderr, "FAIL\n")
    		os.Exit(2)
    	}
    }
    
    // verifyPanic is a special check for the known counter that should be
    // after the panic call in testPanic.
    func verifyPanic() {
    	if coverTest.Count[panicIndex-1] != 1 {
    		// Sanity check for test before panic.
    		fmt.Fprintf(os.Stderr, "bad before panic")
    		PASS = false
    	}
    	if coverTest.Count[panicIndex] != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 04 16:40:40 UTC 2016
    - 3K bytes
    - Viewed (0)
  10. src/reflect/all_test.go

    			},
    		}),
    		struct{ F structFieldType }{})
    }
    
    func TestStructOfExportRules(t *testing.T) {
    	type S1 struct{}
    	type s2 struct{}
    	type ΦType struct{}
    	type φType struct{}
    
    	testPanic := func(i int, mustPanic bool, f func()) {
    		defer func() {
    			err := recover()
    			if err == nil && mustPanic {
    				t.Errorf("test-%d did not panic", i)
    			}
    			if err != nil && !mustPanic {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top