add unit tests.
diff --git a/string_test.go b/string_test.go
index 0d440b8..dda7751 100644
--- a/string_test.go
+++ b/string_test.go
@@ -192,3 +192,11 @@
testDecodeFramework(t, "customReplyStringEmoji", s0)
testJavaDecode(t, "customArgString_emoji", s0)
}
+
+func TestStringComplex(t *testing.T) {
+ // see: test_hessian/src/main/java/test/TestString.java
+ s0 := "킐\u0088中国你好!\u0088\u0088\u0088\u0088\u0088\u0088"
+
+ testDecodeFramework(t, "customReplyComplexString", s0)
+ testJavaDecode(t, "customArgComplexString", s0)
+}
diff --git a/test_hessian/src/main/java/test/TestCustomDecode.java b/test_hessian/src/main/java/test/TestCustomDecode.java
index e2394f5..1c4c276 100644
--- a/test_hessian/src/main/java/test/TestCustomDecode.java
+++ b/test_hessian/src/main/java/test/TestCustomDecode.java
@@ -200,6 +200,11 @@
return TestString.getEmojiTestString().equals(o);
}
+ public Object customArgComplexString() throws Exception {
+ String o = (String) input.readObject();
+ return TestString.getComplexString().equals(o);
+ }
+
public Object customArgTypedFixedList_HashSet() throws Exception {
HashSet o = (HashSet) input.readObject();
return o.contains(0) && o.contains(1);
diff --git a/test_hessian/src/main/java/test/TestCustomReply.java b/test_hessian/src/main/java/test/TestCustomReply.java
index 813d7eb..4586e24 100644
--- a/test_hessian/src/main/java/test/TestCustomReply.java
+++ b/test_hessian/src/main/java/test/TestCustomReply.java
@@ -425,6 +425,11 @@
output.flush();
}
+ public void customReplyComplexString() throws Exception {
+ output.writeObject(TestString.getComplexString());
+ output.flush();
+ }
+
public void customReplyExtendClass() throws Exception {
Dog dog = new Dog();
dog.name = "a dog";
diff --git a/test_hessian/src/main/java/test/TestString.java b/test_hessian/src/main/java/test/TestString.java
index 2ffbdf3..a19cb73 100644
--- a/test_hessian/src/main/java/test/TestString.java
+++ b/test_hessian/src/main/java/test/TestString.java
@@ -29,4 +29,9 @@
return s + ",max" + maxUnicode;
}
+
+ public static String getComplexString() {
+ String s = "킐\u0088中国你好!\u0088\u0088\u0088\u0088\u0088\u0088";
+ return s;
+ }
}