38 lines
820 B
Java
38 lines
820 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 atomIsAtomWithAlias() {
|
|
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)");
|
|
}
|
|
|
|
}
|