fix: fix test
diff --git a/cluster/router/uniform/match_judger/string_match_judger_test.go b/cluster/router/uniform/match_judger/string_match_judger_test.go
index 4f4f2d3..328a7c3 100644
--- a/cluster/router/uniform/match_judger/string_match_judger_test.go
+++ b/cluster/router/uniform/match_judger/string_match_judger_test.go
@@ -17,10 +17,36 @@
package match_judger
-import "testing"
+import (
+ "github.com/apache/dubbo-go/config"
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
func TestNewStringMatchJudger(t *testing.T) {
+ assert.True(t, NewStringMatchJudger(&config.StringMatch{
+ Exact: "abc",
+ }).Judge("abc"))
+ assert.False(t, NewStringMatchJudger(&config.StringMatch{
+ Exact: "abcd",
+ }).Judge("abc"))
+
+ assert.True(t, NewStringMatchJudger(&config.StringMatch{
+ Prefix: "abc",
+ }).Judge("abcd"))
+
+ assert.False(t, NewStringMatchJudger(&config.StringMatch{
+ Exact: "abcd",
+ }).Judge("abdc"))
+
+ assert.True(t, NewStringMatchJudger(&config.StringMatch{
+ Empty: "true",
+ }).Judge(""))
+
+ assert.False(t, NewStringMatchJudger(&config.StringMatch{
+ NoEmpty: "true",
+ }).Judge(""))
}
func TestStringMatchJudger_Judge(t *testing.T) {