transcendental-lisp/test/recursion/TailCallTest.java

33 lines
659 B
Java
Raw Normal View History

2017-11-26 15:11:41 -05:00
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();
}
}