package function.builtin.special;

import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;

import org.junit.Test;

import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import testutil.SymbolAndFunctionCleaner;

public class QUOTETest extends SymbolAndFunctionCleaner {

    @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)");
    }

}
