From 48ff47ff8c3fd4025a2029634c4f4ce3d16f9222 Mon Sep 17 00:00:00 2001 From: Patrick Zheng Date: Wed, 10 Jan 2024 11:14:10 +0800 Subject: [PATCH] add test Signed-off-by: Patrick Zheng --- plugin/manager_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/manager_test.go b/plugin/manager_test.go index 7f841974..899df272 100644 --- a/plugin/manager_test.go +++ b/plugin/manager_test.go @@ -629,6 +629,12 @@ func TestParsePluginName(t *testing.T) { if err == nil || err.Error() != expectedErrorMsg { t.Fatalf("expected %s, but got %v", expectedErrorMsg, err) } + + expectedErrorMsg = "invalid plugin executable file name. Plugin file name requires format notation-{plugin-name}.exe, but got my-plugin" + _, err = parsePluginName("my-plugin") + if err == nil || err.Error() != expectedErrorMsg { + t.Fatalf("expected %s, but got %v", expectedErrorMsg, err) + } } else { pluginName, err = parsePluginName("notation-com.example.plugin") if err != nil {