transcendental-lisp/test/function/builtin/predicate/ATOMTester.java

38 lines
820 B
Java
Raw Normal View History

package function.builtin.predicate;
2017-02-06 13:44:35 -05:00
import static testutil.TestUtilities.evaluateString;
2017-01-27 11:37:11 -05:00
import static testutil.TypeAssertions.*;
import org.junit.Test;
import function.ArgumentValidator.*;
public class ATOMTester {
@Test
2017-01-27 11:37:11 -05:00
public void atomIsAtom() {
assertT(evaluateString("(atom 'a)"));
}
2017-03-07 13:15:40 -05:00
@Test
public void atomIsAtomWithAlias() {
assertT(evaluateString("(atom? 'a)"));
}
@Test
2017-01-27 11:37:11 -05:00
public void listIsNotAtom() {
assertNil(evaluateString("(atom '(1 2 3))"));
}
@Test(expected = TooManyArgumentsException.class)
public void testApplyWithTooManyArguments() {
evaluateString("(atom '1 '2)");
}
@Test(expected = TooFewArgumentsException.class)
public void testApplyWithTooFewArguments() {
evaluateString("(atom)");
}
}