Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for InternalExample (0.25 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/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)
  4. 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)
  5. 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)
  6. src/cmd/go/internal/load/test.go

    {{end}}
    }
    
    var fuzzTargets = []testing.InternalFuzzTarget{
    {{range .FuzzTargets}}
    	{"{{.Name}}", {{.Package}}.{{.Name}}},
    {{end}}
    }
    
    var examples = []testing.InternalExample{
    {{range .Examples}}
    	{"{{.Name}}", {{.Package}}.{{.Name}}, {{.Output | printf "%q"}}, {{.Unordered}}},
    {{end}}
    }
    
    func init() {
    	testdeps.ImportPath = {{.ImportPath | printf "%q"}}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 14:01:23 UTC 2024
    - 28.2K bytes
    - Viewed (0)
  7. api/go1.18.txt

    pkg syscall (windows-amd64), func SyscallN(uintptr, ...uintptr) (uintptr, uintptr, Errno)
    pkg testing, func MainStart(testDeps, []InternalTest, []InternalBenchmark, []InternalFuzzTarget, []InternalExample) *M
    pkg testing, method (*F) Add(...interface{})
    pkg testing, method (*F) Cleanup(func())
    pkg testing, method (*F) Error(...interface{})
    pkg testing, method (*F) Errorf(string, ...interface{})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 20:31:46 UTC 2023
    - 13K bytes
    - Viewed (0)
  8. api/except.txt

    pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8
    pkg testing, func MainStart(func(string, string) (bool, error), []InternalTest, []InternalBenchmark, []InternalExample) *M
    pkg testing, func MainStart(testDeps, []InternalTest, []InternalBenchmark, []InternalExample) *M
    pkg testing, func RegisterCover(Cover)
    pkg text/scanner, const GoTokens = 1012
    pkg text/template/parse, type DotNode bool
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 25 00:13:30 UTC 2023
    - 34.6K bytes
    - Viewed (0)
  9. src/testing/testing.go

    // Systems simulating "go test" should be updated to use MainStart.
    func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample) {
    	os.Exit(MainStart(matchStringOnly(matchString), tests, benchmarks, nil, examples).Run())
    }
    
    // M is a type passed to a TestMain function to run the actual tests.
    type M struct {
    	deps        testDeps
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 76.1K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"InternalBenchmark", Type, 0},
    		{"InternalBenchmark.F", Field, 0},
    		{"InternalBenchmark.Name", Field, 0},
    		{"InternalExample", Type, 0},
    		{"InternalExample.F", Field, 0},
    		{"InternalExample.Name", Field, 0},
    		{"InternalExample.Output", Field, 0},
    		{"InternalExample.Unordered", Field, 7},
    		{"InternalFuzzTarget", Type, 18},
    		{"InternalFuzzTarget.Fn", Field, 18},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top