github.com/cobalt77/jfrog-client-go@v0.14.5/artifactory/services/upload_test.go (about)

     1  package services
     2  
     3  import "testing"
     4  
     5  func TestDebianProperties(t *testing.T) {
     6  	var debianPaths = []struct {
     7  		in       string
     8  		expected string
     9  	}{
    10  		{"dist/comp/arch", ";deb.distribution=dist;deb.component=comp;deb.architecture=arch"},
    11  		{"dist1,dist2/comp/arch", ";deb.distribution=dist1,dist2;deb.component=comp;deb.architecture=arch"},
    12  		{"dist/comp1,comp2/arch", ";deb.distribution=dist;deb.component=comp1,comp2;deb.architecture=arch"},
    13  		{"dist/comp/arch1,arch2", ";deb.distribution=dist;deb.component=comp;deb.architecture=arch1,arch2"},
    14  		{"dist1,dist2/comp1,comp2/arch1,arch2", ";deb.distribution=dist1,dist2;deb.component=comp1,comp2;deb.architecture=arch1,arch2"},
    15  	}
    16  
    17  	for _, v := range debianPaths {
    18  		result := getDebianProps(v.in)
    19  		if result != v.expected {
    20  			t.Errorf("getDebianProps(\"%s\") => '%s', want '%s'", v.in, result, v.expected)
    21  		}
    22  	}
    23  }