Skip to content
Permalink
Browse files
add unit test for #272
  • Loading branch information
wongoo committed Jul 14, 2021
1 parent dad2892 commit 82fbc492cfb2b3ca2931c4523cda34c389a6385d
Showing 2 changed files with 11 additions and 0 deletions.
@@ -146,6 +146,11 @@ func TestString(t *testing.T) {
testDecodeFramework(t, "replyString_null", nil)
}

func TestDecodeJsonString(t *testing.T) {
jsonString := `{"params":{"fromAccid":"23495382","msgType":100,"msgId":"148ef1b2-808d-48f2-b268-7a1018a27bdb","attach":"{\"accid\":\"23495382\",\"classRoomFlag\":50685,\"msgId\":\"599645021431398400\",\"msgType\":\"100\",\"nickname\":\"橙子������\"}","roomid":413256699},"url":"https://api.netease.im/nimserver/chatroom/sendMsg.action"}`
testDecodeFramework(t, "customReplyJsonString", jsonString)
}

func TestStringEncode(t *testing.T) {
s0 := ""
s1 := "0"
@@ -86,6 +86,12 @@ public TestCustomReply(OutputStream os) {
typeMap.put(Date[].class, "[date");
}

public void customReplyJsonString() throws Exception {
String s = "{\"params\":{\"fromAccid\":\"23495382\",\"msgType\":100,\"msgId\":\"148ef1b2-808d-48f2-b268-7a1018a27bdb\",\"attach\":\"{\\\"accid\\\":\\\"23495382\\\",\\\"classRoomFlag\\\":50685,\\\"msgId\\\":\\\"599645021431398400\\\",\\\"msgType\\\":\\\"100\\\",\\\"nickname\\\":\\\"橙子������\\\"}\",\"roomid\":413256699},\"url\":\"https://api.netease.im/nimserver/chatroom/sendMsg.action\"}";
output.writeObject(s);
output.flush();
}

public void customReplyTypedFixedListHasNull() throws Exception {
Object[] o = new Object[]{new A0(), new A1(), null};
output.writeObject(o);

0 comments on commit 82fbc49

Please sign in to comment.