36 lines
772 B
Java
36 lines
772 B
Java
package function.builtin.special;
|
|
|
|
import static testutil.TestUtilities.*;
|
|
|
|
import org.junit.Test;
|
|
|
|
import function.ArgumentValidator.*;
|
|
|
|
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)");
|
|
}
|
|
|
|
}
|