2017-01-14 18:01:14 -05:00
|
|
|
package function.builtin.predicate;
|
2016-12-22 10:32:48 -05:00
|
|
|
|
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.*;
|
2016-12-22 10:32:48 -05:00
|
|
|
|
|
|
|
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)"));
|
2016-12-22 10:32:48 -05:00
|
|
|
}
|
|
|
|
|
2017-03-07 13:15:40 -05:00
|
|
|
@Test
|
|
|
|
public void atomIsAtomWithAlias() {
|
|
|
|
assertT(evaluateString("(atom? 'a)"));
|
|
|
|
}
|
|
|
|
|
2016-12-22 10:32:48 -05:00
|
|
|
@Test
|
2017-01-27 11:37:11 -05:00
|
|
|
public void listIsNotAtom() {
|
|
|
|
assertNil(evaluateString("(atom '(1 2 3))"));
|
2016-12-22 10:32:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = TooManyArgumentsException.class)
|
|
|
|
public void testApplyWithTooManyArguments() {
|
|
|
|
evaluateString("(atom '1 '2)");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test(expected = TooFewArgumentsException.class)
|
|
|
|
public void testApplyWithTooFewArguments() {
|
|
|
|
evaluateString("(atom)");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|