mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
seq, java: fix allocation bug in empty strings and test
Fixes golang/go#9271. Change-Id: I57dcd11ae5afdc23bc9b1a0945d0789c9feeefb1 Reviewed-on: https://go-review.googlesource.com/1423 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
@@ -38,6 +38,20 @@ public class SeqTest extends TestCase {
|
||||
assertEquals("Strings should match", want, got);
|
||||
}
|
||||
|
||||
public void testNilErr() throws Exception {
|
||||
Testpkg.Err(null); // returns nil, no exception
|
||||
}
|
||||
|
||||
public void testErr() {
|
||||
String msg = "Go errors are dropped into the confusing space of exceptions";
|
||||
try {
|
||||
Testpkg.Err(msg);
|
||||
fail("expected non-nil error to be turned into an exception");
|
||||
} catch (Exception e) {
|
||||
assertEquals("messages should match", msg, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void testGoRefGC() {
|
||||
Testpkg.S s = Testpkg.New();
|
||||
runGC();
|
||||
|
||||
Reference in New Issue
Block a user