[tests] prepares Java tests for the language level raise

This commit is contained in:
Roman Shevchenko
2017-03-24 13:09:47 +01:00
parent 05b15f593e
commit 6bd1b92c6e
38 changed files with 129 additions and 166 deletions

View File

@@ -1,6 +1,6 @@
class Test {
interface F<T extends Throwable> {
void _(T t) throws T;
void m(T t) throws T;
}
<K extends Throwable> void foo(F<K> f) throws K { }

View File

@@ -2,14 +2,14 @@ import java.io.IOException;
class Test {
interface F<T extends Throwable> {
void _() throws T;
void m() throws T;
}
void m1() { }
void m2() throws NullPointerException{ }
void m3() throws IOException { }
<K extends Throwable> void foo(F<K> f) throws K { }
{
foo(()->{});
foo(()->{throw new NullPointerException();});
@@ -18,5 +18,5 @@ class Test {
foo(this::m2);
<error descr="Unhandled exception: java.io.IOException">foo(this::m3);</error>
}
}

View File

@@ -1,6 +1,6 @@
class Test {
interface F<T extends ClassNotFoundException> {
void _() throws T;
void m() throws T;
}
<K extends ClassNotFoundException> void foo(F<K> f) throws K { }

View File

@@ -1,13 +1,13 @@
class Test {
interface F<T extends Throwable> {
void _() throws T;
void m() throws T;
}
void m1() { }
void m2() throws ClassNotFoundException { }
void m3() throws Exception { }
<K extends Throwable> void foo1(F<K> f) throws K { }
<K extends ClassNotFoundException> void foo2(F<K> f) throws K { }