Skip to content

Commit 89d83bc

Browse files
committed
feat(dependenttags): Add test case for listType=map and listMapKey
1 parent 52a16ef commit 89d83bc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pkg/analysis/dependenttags/analyzer_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ func TestAnalyzer(t *testing.T) {
4242
Type: dependenttags.DependencyTypeAny,
4343
Dependents: []string{"dep1", "dep2"},
4444
},
45+
{
46+
Identifier: "listType=map",
47+
Type: dependenttags.DependencyTypeAll,
48+
Dependents: []string{"listMapKey"},
49+
},
4550
},
4651
}
4752
analyzer, err := dependenttags.Initializer().Init(&cfg)

pkg/analysis/dependenttags/testdata/src/a/a.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,12 @@ type TypeAlias struct {
5757
// +example:any
5858
ValidAlias MyString
5959
}
60+
61+
type ListMap struct {
62+
// +listType=map
63+
InvalidListMap []string // want "field ListMap.InvalidListMap with marker \\+listType=map is missing required marker\\(s\\): \\+listMapKey"
64+
65+
// +listType=map
66+
// +listMapKey
67+
ValidListMap []string
68+
}

0 commit comments

Comments
 (0)