Use bazel syntax for fully qualified name in path property
A module reference to a fully qualified module in a path property looks like: //path:module And with a tag: //path:module{tag} At the moment the checking is quite lax but some follow up changes will make it much stricter. Bug: 193228441 Test: m nothing Change-Id: Ie42edcfa33ec66fda5d75b3df1da73f56f147afd
This commit is contained in:
@@ -55,6 +55,27 @@ func TestSrcIsModule(t *testing.T) {
|
||||
},
|
||||
wantModule: "foo:bar",
|
||||
},
|
||||
{
|
||||
name: "fully qualified",
|
||||
args: args{
|
||||
s: "//foo:bar",
|
||||
},
|
||||
wantModule: "//foo:bar",
|
||||
},
|
||||
{
|
||||
name: "fully qualified with tag",
|
||||
args: args{
|
||||
s: "//foo:bar{.tag}",
|
||||
},
|
||||
wantModule: "//foo:bar{.tag}",
|
||||
},
|
||||
{
|
||||
name: "invalid unqualified name",
|
||||
args: args{
|
||||
s: ":foo/bar",
|
||||
},
|
||||
wantModule: "",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
@@ -128,6 +149,35 @@ func TestSrcIsModuleWithTag(t *testing.T) {
|
||||
},
|
||||
wantModule: "foo.bar}",
|
||||
},
|
||||
{
|
||||
name: "fully qualified",
|
||||
args: args{
|
||||
s: "//foo:bar",
|
||||
},
|
||||
wantModule: "//foo:bar",
|
||||
},
|
||||
{
|
||||
name: "fully qualified with tag",
|
||||
args: args{
|
||||
s: "//foo:bar{.tag}",
|
||||
},
|
||||
wantModule: "//foo:bar",
|
||||
wantTag: ".tag",
|
||||
},
|
||||
{
|
||||
name: "invalid unqualified name",
|
||||
args: args{
|
||||
s: ":foo/bar",
|
||||
},
|
||||
wantModule: "",
|
||||
},
|
||||
{
|
||||
name: "invalid unqualified name with tag",
|
||||
args: args{
|
||||
s: ":foo/bar{.tag}",
|
||||
},
|
||||
wantModule: "",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user