Move test resources
This commit is contained in:
parent
60e348449b
commit
b67071a7f2
|
@ -99,7 +99,7 @@ public class MainTest extends SymbolAndFunctionCleaner {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void runWithBadFile() {
|
public void runWithBadFile() {
|
||||||
String expectedMessage = "[critical] src/test/application/test-files/bad.lisp (No such file or directory)";
|
String expectedMessage = "[critical] src/test/resources/application/bad.lisp (No such file or directory)";
|
||||||
|
|
||||||
exit.expectSystemExitWithStatus(1);
|
exit.expectSystemExitWithStatus(1);
|
||||||
exit.checkAssertionAfterwards(() -> {
|
exit.checkAssertionAfterwards(() -> {
|
||||||
|
@ -107,12 +107,12 @@ public class MainTest extends SymbolAndFunctionCleaner {
|
||||||
assertEquals("", getSystemOutLog());
|
assertEquals("", getSystemOutLog());
|
||||||
});
|
});
|
||||||
|
|
||||||
runInterpreterWithFile("src/test/application/test-files/bad.lisp");
|
runInterpreterWithFile("src/test/resources/application/bad.lisp");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void runWithFile_PrintsDecoratedLastValueOnly() {
|
public void runWithFile_PrintsDecoratedLastValueOnly() {
|
||||||
runInterpreterWithFile("src/test/application/test-files/file.lisp");
|
runInterpreterWithFile("src/test/resources/application/file.lisp");
|
||||||
|
|
||||||
assertEquals("", getSystemErrLog());
|
assertEquals("", getSystemErrLog());
|
||||||
assertEquals(format("{0}{1}{2}\n\n", ANSI_GREEN, "RADISH", ANSI_RESET), getSystemOutLog());
|
assertEquals(format("{0}{1}{2}\n\n", ANSI_GREEN, "RADISH", ANSI_RESET), getSystemOutLog());
|
||||||
|
@ -136,7 +136,7 @@ public class MainTest extends SymbolAndFunctionCleaner {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void runMain() {
|
public void runMain() {
|
||||||
LispMain.main(new String[] { "src/test/application/test-files/file.lisp" });
|
LispMain.main(new String[] { "src/test/resources/application/file.lisp" });
|
||||||
|
|
||||||
assertEquals("", getSystemErrLog());
|
assertEquals("", getSystemErrLog());
|
||||||
assertEquals(format("{0}{1}{2}\n\n", ANSI_GREEN, "RADISH", ANSI_RESET), getSystemOutLog());
|
assertEquals(format("{0}{1}{2}\n\n", ANSI_GREEN, "RADISH", ANSI_RESET), getSystemOutLog());
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class LOADTest extends SymbolAndFunctionCleaner {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void loadGoodFile_ReturnsTAndPrintsNothing() {
|
public void loadGoodFile_ReturnsTAndPrintsNothing() {
|
||||||
String input = "(load \"src/test/function/builtin/test-files/load-good.lisp\")";
|
String input = "(load \"src/test/resources/function/builtin/load-good.lisp\")";
|
||||||
|
|
||||||
assertT(evaluateString(input));
|
assertT(evaluateString(input));
|
||||||
assertNothingPrinted();
|
assertNothingPrinted();
|
||||||
|
@ -78,7 +78,7 @@ public class LOADTest extends SymbolAndFunctionCleaner {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void loadBadFile_ReturnsNilAndPrintsError() {
|
public void loadBadFile_ReturnsNilAndPrintsError() {
|
||||||
String input = "(load \"src/test/function/builtin/test-files/load-bad.lisp\")";
|
String input = "(load \"src/test/resources/function/builtin/load-bad.lisp\")";
|
||||||
|
|
||||||
assertNil(evaluateString(input));
|
assertNil(evaluateString(input));
|
||||||
assertErrorMessagePrinted();
|
assertErrorMessagePrinted();
|
||||||
|
@ -94,7 +94,7 @@ public class LOADTest extends SymbolAndFunctionCleaner {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void nestedLoadsInTheSameDirectory() {
|
public void nestedLoadsInTheSameDirectory() {
|
||||||
String input = "(load \"src/test/function/builtin/test-files/nested/nested.lisp\")";
|
String input = "(load \"src/test/resources/function/builtin/nested/nested.lisp\")";
|
||||||
|
|
||||||
assertT(evaluateString(input));
|
assertT(evaluateString(input));
|
||||||
assertNothingPrinted();
|
assertNothingPrinted();
|
||||||
|
@ -102,7 +102,7 @@ public class LOADTest extends SymbolAndFunctionCleaner {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void nestedLoadsInDifferentDirectories() {
|
public void nestedLoadsInDifferentDirectories() {
|
||||||
String input = "(load \"src/test/function/builtin/test-files/nested/one/load-one.lisp\")";
|
String input = "(load \"src/test/resources/function/builtin/nested/one/load-one.lisp\")";
|
||||||
|
|
||||||
assertT(evaluateString(input));
|
assertT(evaluateString(input));
|
||||||
assertNothingPrinted();
|
assertNothingPrinted();
|
||||||
|
@ -125,7 +125,7 @@ public class LOADTest extends SymbolAndFunctionCleaner {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void loadUsesRuntimePath() {
|
public void loadUsesRuntimePath() {
|
||||||
environment.setPath("src/test/function/builtin/test-files/nested/one/");
|
environment.setPath("src/test/resources/function/builtin/nested/one/");
|
||||||
String input = "(load \"load-one.lisp\")";
|
String input = "(load \"load-one.lisp\")";
|
||||||
|
|
||||||
assertT(evaluateString(input));
|
assertT(evaluateString(input));
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class LispInterpreterTest {
|
||||||
@Test
|
@Test
|
||||||
public void fileBasedInterpreterWorks_PrintsLastValueOnly() {
|
public void fileBasedInterpreterWorks_PrintsLastValueOnly() {
|
||||||
setCommonFeatures();
|
setCommonFeatures();
|
||||||
builder.useFile("src/test/interpreter/test-files/file.lisp");
|
builder.useFile("src/test/resources/interpreter/file.lisp");
|
||||||
builder.build().interpret();
|
builder.build().interpret();
|
||||||
|
|
||||||
assertEquals("PICKLE\n\n", outputStream.toString());
|
assertEquals("PICKLE\n\n", outputStream.toString());
|
||||||
|
|
Loading…
Reference in New Issue