41 lines
1.0 KiB
Java
41 lines
1.0 KiB
Java
package function.builtin.special;
|
|
|
|
import static testutil.TestUtilities.*;
|
|
import static testutil.TypeAssertions.assertNil;
|
|
|
|
import org.junit.Test;
|
|
|
|
public class PROGNTest {
|
|
|
|
@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 beginWithSeveralArguments() {
|
|
assertSExpressionsMatch(parseString("5"), evaluateString("(begin 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)"));
|
|
}
|
|
|
|
}
|