Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for InternalExample (0.19 sec)

  1. src/testing/example.go

    	"slices"
    	"strings"
    	"time"
    )
    
    type InternalExample struct {
    	Name      string
    	F         func()
    	Output    string
    	Unordered bool
    }
    
    // RunExamples is an internal function but exported because it is cross-package;
    // it is part of the implementation of the "go test" command.
    func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) {
    	_, ok = runExamples(matchString, examples)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  2. src/go/doc/testdata/example.go

    package testing
    
    import (
    	"bytes"
    	"fmt"
    	"io"
    	"os"
    	"strings"
    	"time"
    )
    
    type InternalExample struct {
    	Name   string
    	F      func()
    	Output string
    }
    
    func RunExamples(examples []InternalExample) (ok bool) {
    	ok = true
    
    	var eg InternalExample
    
    	stdout, stderr := os.Stdout, os.Stderr
    	defer func() {
    		os.Stdout, os.Stderr = stdout, stderr
    		if e := recover(); e != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Oct 02 02:28:27 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  3. src/go/doc/testdata/testing.2.golden

    	// An internal function but exported because it is cross-package; ...
    	func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
    
    	// 
    	func RunExamples(examples []InternalExample) (ok bool)
    
    	// 
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 4.1K bytes
    - Viewed (0)
  4. src/go/doc/testdata/testing.0.golden

    	// An internal function but exported because it is cross-package; ...
    	func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
    
    	// 
    	func RunExamples(examples []InternalExample) (ok bool)
    
    	// 
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 4.1K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/whitelist.go

    	"unicode.Range16": true,
    	"unicode.Range32": true,
    
    	// These four structs are used in generated test main files,
    	// but the generator can be trusted.
    	"testing.InternalBenchmark":  true,
    	"testing.InternalExample":    true,
    	"testing.InternalTest":       true,
    	"testing.InternalFuzzTarget": true,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 17 00:08:36 UTC 2022
    - 1.1K bytes
    - Viewed (0)
  6. src/testing/run_example.go

    // example.go when js/wasm gets an os.Pipe implementation
    // and no longer needs this separation.
    
    package testing
    
    import (
    	"fmt"
    	"io"
    	"os"
    	"strings"
    	"time"
    )
    
    func runExample(eg InternalExample) (ok bool) {
    	if chatty.on {
    		fmt.Printf("%s=== RUN   %s\n", chatty.prefix(), eg.Name)
    	}
    
    	// Capture stdout.
    	stdout := os.Stdout
    	r, w, err := os.Pipe()
    	if err != nil {
    		fmt.Fprintln(os.Stderr, err)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  7. src/go/doc/testdata/testing.1.golden

    	// An internal function but exported because it is cross-package; ...
    	func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
    
    	// 
    	func RunExamples(examples []InternalExample) (ok bool)
    
    	// 
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 8.4K bytes
    - Viewed (0)
  8. src/testing/run_example_wasm.go

    package testing
    
    import (
    	"fmt"
    	"io"
    	"os"
    	"strings"
    	"time"
    )
    
    // TODO(@musiol, @odeke-em): unify this code back into
    // example.go when js/wasm gets an os.Pipe implementation.
    func runExample(eg InternalExample) (ok bool) {
    	if chatty.on {
    		fmt.Printf("%s=== RUN   %s\n", chatty.prefix(), eg.Name)
    	}
    
    	// Capture stdout to temporary file. We're not using
    	// os.Pipe because it is not supported on js/wasm.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  9. pkg/util/coverage/coverage.go

    	// coverage information to disk. To achieve this, we create a bunch of empty test suites and
    	// have it "run" them.
    	tests := []testing.InternalTest{}
    	benchmarks := []testing.InternalBenchmark{}
    	examples := []testing.InternalExample{}
    	fuzztargets := []testing.InternalFuzzTarget{}
    
    	var deps fakeTestDeps
    
    	dummyRun := testing.MainStart(deps, tests, benchmarks, fuzztargets, examples)
    	dummyRun.Run()
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 05 21:00:21 UTC 2022
    - 3.2K bytes
    - Viewed (0)
  10. src/go/doc/testdata/testing.go

    // An internal function but exported because it is cross-package; part of the implementation
    // of go test.
    func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample) {
    	flag.Parse()
    	parseCpuList()
    
    	before()
    	startAlarm()
    	testOk := RunTests(matchString, tests)
    	exampleOk := RunExamples(examples)
    	if !testOk || !exampleOk {
    		fmt.Println("FAIL")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Oct 02 02:28:27 UTC 2022
    - 11.8K bytes
    - Viewed (0)
Back to top