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

33 lines
716 B
Java

package function.builtin.predicate;
import static testutil.TestUtilities.evaluateString;
import static testutil.TypeAssertions.*;
import org.junit.Test;
import function.ArgumentValidator.*;
public class ATOMTester {
@Test
public void atomIsAtom() {
assertT(evaluateString("(atom 'a)"));
}
@Test
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)");
}
}