Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for test_duration (0.28 sec)

  1. src/log/slog/internal/benchmarks/benchmarks_test.go

    							slog.Time("time", testTime),
    							slog.Any("error", testError),
    							slog.String("string", testString),
    							slog.Int("status", testInt),
    							slog.Duration("duration", testDuration),
    							slog.Time("time", testTime),
    							slog.Any("error", testError),
    							slog.String("string", testString),
    							slog.Int("status", testInt),
    							slog.Duration("duration", testDuration),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  2. pkg/cmd/flag_test.go

    	cmd := &cobra.Command{}
    	var testDuration time.Duration
    	flag.DurationVar(&testDuration, "testduration", defaultDuration, "test duration flag")
    	AddFlags(cmd)
    
    	testName := "Initialize duration flag"
    	if !flag.Parsed() {
    		t.Errorf("%s: flag.Parsed() returns false, should be true", testName)
    	}
    
    	cmd.Flags().VisitAll(func(f *pflag.Flag) {
    		if f.Name != "testduration" {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 29 20:42:01 UTC 2020
    - 3.4K bytes
    - Viewed (0)
  3. src/log/slog/internal/benchmarks/benchmarks.go

    	testString   = "7e3b3b2aaeff56a7108fe11e154200dd/7819479873059528190"
    	testInt      = 32768
    	testDuration = 23 * time.Second
    	testError    = errors.New("fail")
    )
    
    var testAttrs = []slog.Attr{
    	slog.String("string", testString),
    	slog.Int("status", testInt),
    	slog.Duration("duration", testDuration),
    	slog.Time("time", testTime),
    	slog.Any("error", testError),
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Mar 25 12:14:46 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  4. pkg/env/var_test.go

    		t.Errorf("Expected 789.0, got %v", v)
    	}
    	if !present {
    		t.Errorf("Expected present")
    	}
    
    	v = ev.Get()
    	if v != 789 {
    		t.Errorf("Expected 789.0, got %v", v)
    	}
    }
    
    func TestDuration(t *testing.T) {
    	reset()
    
    	ev := RegisterDurationVar(testVar, 123*time.Second, "")
    	v, present := ev.Lookup()
    	if v != 123*time.Second {
    		t.Errorf("Expected 123 seconds, got %v", v)
    	}
    	if present {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 8.1K bytes
    - Viewed (0)
Back to top