Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for test_duration (0.35 sec)

  1. src/flag/flag_test.go

    	Int64("test_int64", 0, "int64 value")
    	Uint("test_uint", 0, "uint value")
    	Uint64("test_uint64", 0, "uint64 value")
    	String("test_string", "0", "string value")
    	Float64("test_float64", 0, "float64 value")
    	Duration("test_duration", 0, "time.Duration value")
    	Func("test_func", "func value", func(string) error { return nil })
    	BoolFunc("test_boolfunc", "func", func(string) error { return nil })
    
    	m := make(map[string]*Flag)
    	desired := "0"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 18:38:24 UTC 2024
    - 22K bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. 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)
  5. 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