diff --git a/src/test/kotlin/recursion/TailCallTest.java b/src/test/kotlin/recursion/TailCallTest.java deleted file mode 100644 index f8dd401..0000000 --- a/src/test/kotlin/recursion/TailCallTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package recursion; - -import org.junit.Test; - -import static recursion.TailCalls.done; - -public class TailCallTest { - - @Test(expected = UnsupportedOperationException.class) - public void tailCallDoesNotSupportResult() { - TailCall tailCall = new TailCall() { - - @Override - public TailCall apply() { - return null; - } - }; - - tailCall.result(); - } - - @Test(expected = UnsupportedOperationException.class) - public void doneDoesNotSupportApply() { - done(null).apply(); - } - - @Test - public void TailCallsCoverage() { - new TailCalls(); - } -} diff --git a/src/test/kotlin/recursion/TailCallTest.kt b/src/test/kotlin/recursion/TailCallTest.kt new file mode 100644 index 0000000..9e0ef74 --- /dev/null +++ b/src/test/kotlin/recursion/TailCallTest.kt @@ -0,0 +1,20 @@ +package recursion + +import org.junit.jupiter.api.Assertions.assertThrows +import org.junit.jupiter.api.Test +import recursion.TailCalls.done + +class TailCallTest { + + @Test + fun `tailCall does not support result`() { + val tailCall = TailCall { null } + + assertThrows(UnsupportedOperationException::class.java) { tailCall.result() } + } + + @Test + fun `done does not support apply`() { + assertThrows(UnsupportedOperationException::class.java) { done(null).apply() } + } +}