Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for createConstantString (0.15 sec)

  1. pkg/test/framework/tools/featuresgen/cmd/root_test.go

    	"testing"
    
    	"gopkg.in/yaml.v2"
    )
    
    func TestCreateConstantString(t *testing.T) {
    	s1 := createConstantString([]string{"lab-el1", "label2"})
    	if s1 != "\tLabEl1_Label2\tFeature = \"lab-el1.label2\"" {
    		t.Errorf("Expected '\tLabEl1_Label2\tFeature = \"lab-el1.label2\"' got '%s'", s1)
    	}
    
    	s2 := createConstantString([]string{"lab.*)($)#el1", "lab.el2"})
    	if s2 != "\tLabel1_Label2\tFeature = \"lab*)($)#el1.label2\"" {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  2. pkg/test/framework/tools/featuresgen/cmd/root.go

    func readVal(v any, path []string) []string {
    	typ := reflect.TypeOf(v).Kind()
    	if typ == reflect.Int || typ == reflect.String {
    		path = append(path, v.(string))
    		return []string{createConstantString(path)}
    	} else if typ == reflect.Slice {
    		return readSlice(v.([]any), path)
    	} else if typ == reflect.Map {
    		return readMap(v.(map[any]any), path)
    	}
    	panic("Found invalid type in YAML file")
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 5.4K bytes
    - Viewed (0)
Back to top