Increase test coverage
This commit is contained in:
parent
314053a9eb
commit
0825d1ee96
|
@ -1,4 +1,4 @@
|
|||
|TranscendentalLisp.Recursion||10:09:13 Sun, Nov 26, 2017|
|
||||
|TranscendentalLisp.Recursion||15:06:26 Sun, Nov 26, 2017|
|
||||
|TranscendentalLisp||16:15:14 Fri, Mar 17, 2017|
|
||||
|TranscendentalLisp.Macros||10:10:15 Mon, Mar 13, 2017|
|
||||
|TranscendentalLisp.MacroTests||10:07:00 Mon, Mar 13, 2017|
|
||||
|
|
|
@ -26,4 +26,4 @@ Test recursion capabilities of various functions.
|
|||
| check | evaluate text | (eval (append `(let ,(list-of '(x 20) 10000)) big-list)) | 1 |
|
||||
| check | evaluate text | (apply 'cond (list-of '((= 1 2) 1) 10000)) | NIL |
|
||||
| check | evaluate text | (eval (append '(case :a) (list-of '((:b :c :d) 1) 10000))) | NIL |
|
||||
| check | evaluate text | (nested-list 2000) | =~/\)\)$/ |
|
||||
| check | evaluate text | (nested-list 1500) | =~/\)\)$/ |
|
||||
|
|
|
@ -38,12 +38,11 @@ public class TokenFactoryImpl implements TokenFactory {
|
|||
case COMMA:
|
||||
return new Comma(text, position);
|
||||
default:
|
||||
if (isNumeric(firstCharacter, text)) {
|
||||
if (isNumeric(firstCharacter, text))
|
||||
return new Number(text, position);
|
||||
} else if (isLegalIdentifierCharacter(firstCharacter)) {
|
||||
else if (isLegalIdentifierCharacter(firstCharacter))
|
||||
return new Identifier(text, position);
|
||||
}
|
||||
}
|
||||
|
||||
throw new BadCharacterException(text, position);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
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();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue