transcendental-lisp/test/function/builtin/special/QUOTETester.java

36 lines
790 B
Java
Raw Normal View History

package function.builtin.special;
import static testutil.TestUtilities.*;
import org.junit.Test;
import function.ArgumentValidator.*;
public class QUOTETester {
@Test
public void testQuoteSymbol() {
String input = "'a";
assertSExpressionsMatch(evaluateString(input), parseString("a"));
}
@Test
public void testQuoteList() {
String input = "'(l i s t)";
assertSExpressionsMatch(evaluateString(input), parseString("(l i s t)"));
}
@Test(expected = TooFewArgumentsException.class)
public void testQuoteWithTooFewArguments() {
evaluateString("(quote)");
}
@Test(expected = TooManyArgumentsException.class)
public void testQuoteWithTooManyArguments() {
evaluateString("(quote a b)");
}
}