36 lines
894 B
Java
36 lines
894 B
Java
|
package function.builtin.special;
|
||
|
|
||
|
import static testutil.TestUtilities.*;
|
||
|
import static testutil.TypeAssertions.assertNil;
|
||
|
|
||
|
import org.junit.Test;
|
||
|
|
||
|
public class PROGNTester {
|
||
|
|
||
|
@Test
|
||
|
public void prognWithNoArguments() {
|
||
|
assertNil(evaluateString("(progn)"));
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void prognWithOneArgument() {
|
||
|
assertSExpressionsMatch(parseString("1"), evaluateString("(progn 1)"));
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void prognWithSeveralArguments() {
|
||
|
assertSExpressionsMatch(parseString("5"), evaluateString("(progn 1 2 3 4 5)"));
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void prognEvaluatesArgument() {
|
||
|
assertSExpressionsMatch(parseString("1"), evaluateString("(progn (car '(1 2 3)))"));
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void prognWithDifferentArgumentTypes() {
|
||
|
assertSExpressionsMatch(parseString("pear"), evaluateString("(progn t nil '(1 2) 'pear)"));
|
||
|
}
|
||
|
|
||
|
}
|