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

36 lines
772 B
Java
Raw Normal View History

package function.builtin.special;
import static testutil.TestUtilities.*;
import org.junit.Test;
import function.ArgumentValidator.*;
2017-03-15 13:37:39 -04:00
public class QUOTETest {
@Test
public void quoteSymbol() {
String input = "'a";
assertSExpressionsMatch(parseString("a"), evaluateString(input));
}
@Test
public void quoteList() {
String input = "'(l i s t)";
assertSExpressionsMatch(parseString("(l i s t)"), evaluateString(input));
}
@Test(expected = TooFewArgumentsException.class)
public void quoteWithTooFewArguments() {
evaluateString("(quote)");
}
@Test(expected = TooManyArgumentsException.class)
public void quoteWithTooManyArguments() {
evaluateString("(quote a b)");
}
}