Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for fmtDuration (0.1 sec)

  1. src/testing/example.go

    // made to fail and panic with errNilPanicOrGoexit
    func (eg *InternalExample) processRunResult(stdout string, timeSpent time.Duration, finished bool, recovered any) (passed bool) {
    	passed = true
    	dstr := fmtDuration(timeSpent)
    	var fail string
    	got := strings.TrimSpace(stdout)
    	want := strings.TrimSpace(eg.Output)
    	if eg.Unordered {
    		if sortLines(got) != sortLines(want) && recovered == nil {
    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/testing/fuzz.go

    			if _, ok, _ := f.testContext.match.fullName(nil, name); ok {
    				run(f.w, e)
    			}
    		}
    	}
    }
    
    func (f *F) report() {
    	if *isFuzzWorker || f.parent == nil {
    		return
    	}
    	dstr := fmtDuration(f.duration)
    	format := "--- %s: %s (%s)\n"
    	if f.Failed() {
    		f.flushToParent(f.name, format, "FAIL", f.name, dstr)
    	} else if f.chatty != nil {
    		if f.Skipped() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 22:55:25 UTC 2024
    - 22.9K bytes
    - Viewed (0)
  3. src/testing/testing.go

    		}
    		const indent = "    "
    		w.c.output = append(w.c.output, indent...)
    		w.c.output = append(w.c.output, line...)
    		b = b[end:]
    	}
    	return
    }
    
    // fmtDuration returns a string representing d in the form "87.00s".
    func fmtDuration(d time.Duration) string {
    	return fmt.Sprintf("%.2fs", d.Seconds())
    }
    
    // TB is the interface common to T, B, and F.
    type TB interface {
    	Cleanup(func())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 76.1K bytes
    - Viewed (0)
Back to top