#72 Add support for plugin names with underscore
This commit is contained in:
		
							parent
							
								
									aecfd500f1
								
							
						
					
					
						commit
						5c55db489f
					
				|  | @ -22,7 +22,7 @@ func (p Plugin) String() string { | |||
| } | ||||
| 
 | ||||
| var ( | ||||
| 	namePattern    = regexp.MustCompile(`^[0-9a-z-]+$`) | ||||
| 	namePattern    = regexp.MustCompile(`^[0-9a-z-_]+$`) | ||||
| 	versionPattern = regexp.MustCompile(`^[0-9\\.]+$`) | ||||
| ) | ||||
| 
 | ||||
|  |  | |||
|  | @ -32,6 +32,18 @@ func TestVerifyDependencies(t *testing.T) { | |||
| 		got := VerifyDependencies(basePlugins) | ||||
| 		assert.Equal(t, true, got) | ||||
| 	}) | ||||
| 	t.Run("happy, two plugin names with names with underscores", 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) { | ||||
| 		basePlugins := map[Plugin][]Plugin{ | ||||
| 			Must(New("first-root-plugin:1.0.0")): { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue