Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for IsKVPathElement (1.57 sec)

  1. operator/pkg/util/path.go

    }
    
    // IsValidPathElement reports whether pe is a valid path element.
    func IsValidPathElement(pe string) bool {
    	return ValidKeyRegex.MatchString(pe)
    }
    
    // IsKVPathElement report whether pe is a key/value path element.
    func IsKVPathElement(pe string) bool {
    	pe, ok := RemoveBrackets(pe)
    	if !ok {
    		return false
    	}
    
    	kv := splitEscaped(pe, kvSeparatorRune)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Dec 12 17:12:54 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  2. operator/pkg/util/path_test.go

    			expect: false,
    		},
    		{
    			desc:   "one-bracket",
    			in:     "[1:2",
    			expect: false,
    		},
    	}
    
    	for _, tt := range tests {
    		t.Run(tt.desc, func(t *testing.T) {
    			if got := IsKVPathElement(tt.in); got != tt.expect {
    				t.Errorf("%s: expect %v got %v", tt.desc, tt.expect, got)
    			}
    		})
    	}
    }
    
    func TestIsVPathElement(t *testing.T) {
    	tests := []struct {
    		desc   string
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Aug 29 00:15:38 UTC 2020
    - 6.7K bytes
    - Viewed (0)
Back to top