Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for str (0.16 sec)

  1. internal/bucket/versioning/versioning_test.go

    	v := Versioning{
    		Status: Enabled,
    	}
    	buf, err := xml.Marshal(v)
    	if err != nil {
    		t.Fatalf("Failed to marshal %v: %v", v, err)
    	}
    
    	str := string(buf)
    	if strings.Contains(str, "ExcludedPrefixes") {
    		t.Fatalf("XML shouldn't contain ExcludedPrefixes tag - %s", str)
    	}
    }
    
    func TestVersioningZero(t *testing.T) {
    	var v Versioning
    	if v.Enabled() {
    		t.Fatalf("Expected to be disabled but got enabled")
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun May 08 05:06:44 GMT 2022
    - 8.8K bytes
    - Viewed (0)
  2. internal/s3select/sql/value.go

    }
    
    // FromInt creates a Value from an int
    func FromInt(f int64) *Value {
    	return &Value{value: f}
    }
    
    // FromString creates a Value from a string
    func FromString(str string) *Value {
    	return &Value{value: str}
    }
    
    // FromBool creates a Value from a bool
    func FromBool(b bool) *Value {
    	return &Value{value: b}
    }
    
    // FromTimestamp creates a Value from a timestamp
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Feb 25 20:31:19 GMT 2022
    - 20.2K bytes
    - Viewed (0)
  3. internal/config/bool-flag.go

    // Any other value returns an error.
    func ParseBool(str string) (bool, error) {
    	switch str {
    	case "1", "t", "T", "true", "TRUE", "True", "on", "ON", "On":
    		return true, nil
    	case "0", "f", "F", "false", "FALSE", "False", "off", "OFF", "Off":
    		return false, nil
    	}
    	if strings.EqualFold(str, "enabled") {
    		return true, nil
    	}
    	if strings.EqualFold(str, "disabled") {
    		return false, nil
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 07 15:10:40 GMT 2022
    - 2.3K bytes
    - Viewed (0)
  4. internal/s3select/sql/jsonpath_test.go

    		{"s.authorInfo.yearRange[0]", []interface{}{1890.0, 1920.0, 1881.0}},
    		{"s.publicationHistory[0].pages", []interface{}{256.0, 336.0, Missing{}}},
    	}
    	for i, tc := range cases {
    		t.Run(tc.str, func(t *testing.T) {
    			jp := JSONPath{}
    			err := p.ParseString(tc.str, &jp)
    			// fmt.Println(jp)
    			if err != nil {
    				t.Fatalf("parse failed!: %d %v %s", i, err, tc)
    			}
    
    			// Read only the first json object from the file
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 2.8K bytes
    - Viewed (0)
  5. internal/config/bool-flag_test.go

    		expectedResult string
    	}{
    		{bf, "off"},
    		{BoolFlag(true), "on"},
    		{BoolFlag(false), "off"},
    	}
    
    	for _, testCase := range testCases {
    		str := testCase.flag.String()
    		if testCase.expectedResult != str {
    			t.Fatalf("expected: %v, got: %v", testCase.expectedResult, str)
    		}
    	}
    }
    
    // Test BoolFlag.MarshalJSON()
    func TestBoolFlagMarshalJSON(t *testing.T) {
    	var bf BoolFlag
    
    	testCases := []struct {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 3.5K bytes
    - Viewed (0)
  6. cmd/object-api-utils.go

    // Comparison is case insensitive. Explicit short-circuit if
    // the list contains the wildcard "*".
    func hasStringSuffixInSlice(str string, list []string) bool {
    	str = strings.ToLower(str)
    	for _, v := range list {
    		if v == "*" {
    			return true
    		}
    
    		if strings.HasSuffix(str, strings.ToLower(v)) {
    			return true
    		}
    	}
    	return false
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Mar 11 11:55:34 GMT 2024
    - 35.6K bytes
    - Viewed (1)
  7. internal/config/compress/compress_test.go

    		{"text/*,application/json", []string{"text/*", "application/json"}, true},
    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run(testCase.str, func(t *testing.T) {
    			gotPatterns, err := parseCompressIncludes(testCase.str)
    			if !testCase.success && err == nil {
    				t.Error("expected failure but success instead")
    			}
    			if testCase.success && err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 1.8K bytes
    - Viewed (0)
  8. internal/amztime/parse.go

    }
    
    // ParseReplicationTS parse http.TimeFormat first
    // will try time.RFC3339Nano when parse http.TimeFormat failed
    func ParseReplicationTS(str string) (time.Time, error) {
    	tm, err := time.Parse(http.TimeFormat, str)
    	if tm.IsZero() || err != nil {
    		tm, err = time.Parse(time.RFC3339Nano, str)
    	}
    	return tm, err
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  9. internal/config/config_test.go

    			keys:           []string{"connection_string", "comment"},
    			expectedFields: map[string]struct{}{},
    		},
    		// Incorrect type of input v/s required keys.
    		{
    			input:          `comme="really long comment" connection_str="host=localhost port=2832"`,
    			keys:           []string{"connection_string", "comment"},
    			expectedFields: map[string]struct{}{},
    		},
    	}
    	for _, test := range tests {
    		test := test
    		t.Run("", func(t *testing.T) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Aug 18 22:55:17 GMT 2022
    - 4.2K bytes
    - Viewed (0)
  10. cmd/update_test.go

    			}
    		}
    
    		str := getUserAgent(testCase.mode)
    		expectedStr := testCase.expectedStr
    		if IsDocker() {
    			expectedStr = strings.ReplaceAll(expectedStr, "; source", "; docker; source")
    		}
    		if !strings.Contains(str, expectedStr) {
    			t.Errorf("Test %d: expected: %s, got: %s", i+1, expectedStr, str)
    		}
    		globalIsCICD = sci
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Mar 09 03:07:08 GMT 2024
    - 10.7K bytes
    - Viewed (0)
Back to top