33 lines
659 B
Java
33 lines
659 B
Java
|
package recursion;
|
||
|
|
||
|
import static recursion.TailCalls.done;
|
||
|
|
||
|
import org.junit.Test;
|
||
|
|
||
|
public class TailCallTest {
|
||
|
|
||
|
@Test(expected = UnsupportedOperationException.class)
|
||
|
public void tailCallDoesNotSupportResult() {
|
||
|
TailCall<Object> tailCall = new TailCall<Object>() {
|
||
|
|
||
|
@Override
|
||
|
public TailCall<Object> apply() {
|
||
|
return null;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
tailCall.result();
|
||
|
}
|
||
|
|
||
|
@Test(expected = UnsupportedOperationException.class)
|
||
|
public void doneDoesNotSupportApply() {
|
||
|
done(null).apply();
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void TailCallsCoverage() {
|
||
|
new TailCalls();
|
||
|
}
|
||
|
|
||
|
}
|