AlexStocks commented on code in PR #327:
URL: https://github.com/apache/dubbo-go-hessian2/pull/327#discussion_r1002613851


##########
object_test.go:
##########
@@ -1061,3 +1062,58 @@ func TestDecodeSliceIntegerHasNull(t *testing.T) {
        RegisterPOJO(&User{})
        testDecodeFramework(t, "customReplyTypedListIntegerHasNull", &User{Id: 
0, List: []int32{1, 0}})
 }
+
+func TestDecodeCustomReplyEnumVariableList(t *testing.T) {
+       for v := range _LocaleCategoryEnumValues {
+               RegisterJavaEnum(v)
+       }
+
+       got, err := decodeJavaResponse(`customReplyEnumVariableList`, ``, false)
+       assert.NoError(t, err)
+       t.Logf("customReplyEnumVariableList %T %+v", got, got)
+       enumList, ok := got.([]*LocaleCategoryEnum)
+       if !ok {
+               t.Errorf("expect []LocaleCategoryEnum, but get %v", got)
+               return
+       }
+       assert.Equal(t, LocaleCategoryEnumDisplay, *enumList[0])
+       assert.Nil(t, enumList[1])
+       assert.Equal(t, LocaleCategoryEnumFormat, *enumList[2])
+}
+
+const (
+       LocaleCategoryEnumDisplay LocaleCategoryEnum = iota
+       LocaleCategoryEnumFormat
+)
+
+var _LocaleCategoryEnumValues = map[LocaleCategoryEnum]string{

Review Comment:
   放在一个 var () 大 block 内



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to