Add test for input errors
This commit is contained in:
parent
eaf80390be
commit
c2c53e0d0f
|
@ -1,24 +1,16 @@
|
||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Test" type="JUnit" factoryName="JUnit">
|
<configuration default="false" name="Test" type="JUnit" factoryName="JUnit">
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<module name="transcendental-lisp" />
|
<module name="transcendental-lisp" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
<extension name="coverage" sample_coverage="false" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
|
||||||
<option name="PACKAGE_NAME" value="" />
|
<option name="PACKAGE_NAME" value="" />
|
||||||
<option name="MAIN_CLASS_NAME" value="" />
|
<option name="MAIN_CLASS_NAME" value="" />
|
||||||
<option name="METHOD_NAME" value="" />
|
<option name="METHOD_NAME" value="" />
|
||||||
<option name="TEST_OBJECT" value="package" />
|
<option name="TEST_OBJECT" value="package" />
|
||||||
<option name="VM_PARAMETERS" value="-ea" />
|
|
||||||
<option name="PARAMETERS" value="" />
|
<option name="PARAMETERS" value="" />
|
||||||
<option name="WORKING_DIRECTORY" value="file://%MODULE_WORKING_DIR%" />
|
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
|
||||||
<option name="ENV_VARIABLES" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<option name="TEST_SEARCH_SCOPE">
|
|
||||||
<value defaultName="singleModule" />
|
|
||||||
</option>
|
|
||||||
<envs />
|
|
||||||
<dir value="$PROJECT_DIR$/src/test/java" />
|
<dir value="$PROJECT_DIR$/src/test/java" />
|
||||||
<patterns />
|
<method v="2">
|
||||||
<method />
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
|
@ -140,7 +140,18 @@ class LispInterpreterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interpreterHandlesError() {
|
fun interpreterHandlesInputError() {
|
||||||
|
setCommonFeatures()
|
||||||
|
LispInterpreterBuilder.setNotInteractive()
|
||||||
|
LispInterpreterBuilder.setInput(createInputStreamFromString("['pickle"), "input")
|
||||||
|
LispInterpreterBuilder.build().interpret()
|
||||||
|
|
||||||
|
assertEquals("PICKLE\n\n", outputStream.toString())
|
||||||
|
assertEquals("[error] illegal character >>[<< - line 1, column 1\n", errorOutputStream.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun interpreterHandlesEvaluationError() {
|
||||||
setCommonFeatures()
|
setCommonFeatures()
|
||||||
LispInterpreterBuilder.setNotInteractive()
|
LispInterpreterBuilder.setNotInteractive()
|
||||||
LispInterpreterBuilder.setInput(createInputStreamFromString("pickle"), "input")
|
LispInterpreterBuilder.setInput(createInputStreamFromString("pickle"), "input")
|
||||||
|
|
Loading…
Reference in New Issue