failing test for try/catch
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
fun foo(s: String): String? {
|
||||||
|
try {
|
||||||
|
Integer.parseInt(s);
|
||||||
|
return "no message";
|
||||||
|
}
|
||||||
|
catch(e: NumberFormatException) {
|
||||||
|
return e.getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -100,4 +100,11 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
assertTrue(caught);
|
assertTrue(caught);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testTryCatch() throws Exception {
|
||||||
|
loadFile("tryCatch.jet");
|
||||||
|
final Method main = generateFunction();
|
||||||
|
assertEquals("no message", main.invoke(null, "0"));
|
||||||
|
assertEquals("xxx", main.invoke(null, "a"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user