Merge pull request #110 from mxandeco/add_support_for_uppercase_plugin
change plugin name regex to case-insensitive.
This commit is contained in:
commit
00a44035a6
|
|
@ -22,7 +22,7 @@ func (p Plugin) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
namePattern = regexp.MustCompile(`^[0-9a-z-_]+$`)
|
namePattern = regexp.MustCompile(`(?i)^[0-9a-z-_]+$`)
|
||||||
versionPattern = regexp.MustCompile(`^[0-9\\.]+$`)
|
versionPattern = regexp.MustCompile(`^[0-9\\.]+$`)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,18 @@ func TestVerifyDependencies(t *testing.T) {
|
||||||
got := VerifyDependencies(basePlugins)
|
got := VerifyDependencies(basePlugins)
|
||||||
assert.Equal(t, true, got)
|
assert.Equal(t, true, got)
|
||||||
})
|
})
|
||||||
|
t.Run("happy, two plugin names with uppercase names", func(t *testing.T) {
|
||||||
|
basePlugins := map[Plugin][]Plugin{
|
||||||
|
Must(New("First-Root-Plugin:1.0.0")): {
|
||||||
|
Must(New("First_Plugin:0.0.1")),
|
||||||
|
},
|
||||||
|
Must(New("Second_Root_Plugin:1.0.0")): {
|
||||||
|
Must(New("First_Plugin:0.0.1")),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
got := VerifyDependencies(basePlugins)
|
||||||
|
assert.Equal(t, true, got)
|
||||||
|
})
|
||||||
t.Run("fail, two root plugins have different versions", func(t *testing.T) {
|
t.Run("fail, two root plugins have different versions", func(t *testing.T) {
|
||||||
basePlugins := map[Plugin][]Plugin{
|
basePlugins := map[Plugin][]Plugin{
|
||||||
Must(New("first-root-plugin:1.0.0")): {
|
Must(New("first-root-plugin:1.0.0")): {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue