From b67071a7f22de110ca546f1c74e972db26b7f176 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Sat, 17 Mar 2018 14:37:02 -0400 Subject: [PATCH] Move test resources --- src/test/java/application/MainTest.java | 8 ++++---- src/test/java/function/builtin/LOADTest.java | 10 +++++----- src/test/java/interpreter/LispInterpreterTest.java | 2 +- .../test-files => resources/application}/file.lisp | 0 .../function/builtin}/load-bad.lisp | 0 .../function/builtin}/load-good.lisp | 0 .../function/builtin}/nested/included.lisp | 0 .../function/builtin}/nested/nested.lisp | 0 .../function/builtin}/nested/one/load-one.lisp | 0 .../function/builtin}/nested/one/two/load-two.lisp | 0 .../builtin}/nested/one/two/three/load-three.lisp | 0 .../test-files => resources/interpreter}/file.lisp | 0 12 files changed, 10 insertions(+), 10 deletions(-) rename src/test/{java/application/test-files => resources/application}/file.lisp (100%) rename src/test/{java/function/builtin/test-files => resources/function/builtin}/load-bad.lisp (100%) rename src/test/{java/function/builtin/test-files => resources/function/builtin}/load-good.lisp (100%) rename src/test/{java/function/builtin/test-files => resources/function/builtin}/nested/included.lisp (100%) rename src/test/{java/function/builtin/test-files => resources/function/builtin}/nested/nested.lisp (100%) rename src/test/{java/function/builtin/test-files => resources/function/builtin}/nested/one/load-one.lisp (100%) rename src/test/{java/function/builtin/test-files => resources/function/builtin}/nested/one/two/load-two.lisp (100%) rename src/test/{java/function/builtin/test-files => resources/function/builtin}/nested/one/two/three/load-three.lisp (100%) rename src/test/{java/interpreter/test-files => resources/interpreter}/file.lisp (100%) diff --git a/src/test/java/application/MainTest.java b/src/test/java/application/MainTest.java index 6488e87..2d70b38 100644 --- a/src/test/java/application/MainTest.java +++ b/src/test/java/application/MainTest.java @@ -99,7 +99,7 @@ public class MainTest extends SymbolAndFunctionCleaner { @Test 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.checkAssertionAfterwards(() -> { @@ -107,12 +107,12 @@ public class MainTest extends SymbolAndFunctionCleaner { assertEquals("", getSystemOutLog()); }); - runInterpreterWithFile("src/test/application/test-files/bad.lisp"); + runInterpreterWithFile("src/test/resources/application/bad.lisp"); } @Test public void runWithFile_PrintsDecoratedLastValueOnly() { - runInterpreterWithFile("src/test/application/test-files/file.lisp"); + runInterpreterWithFile("src/test/resources/application/file.lisp"); assertEquals("", getSystemErrLog()); assertEquals(format("{0}{1}{2}\n\n", ANSI_GREEN, "RADISH", ANSI_RESET), getSystemOutLog()); @@ -136,7 +136,7 @@ public class MainTest extends SymbolAndFunctionCleaner { @Test 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(format("{0}{1}{2}\n\n", ANSI_GREEN, "RADISH", ANSI_RESET), getSystemOutLog()); diff --git a/src/test/java/function/builtin/LOADTest.java b/src/test/java/function/builtin/LOADTest.java index f8c150f..fb21610 100644 --- a/src/test/java/function/builtin/LOADTest.java +++ b/src/test/java/function/builtin/LOADTest.java @@ -70,7 +70,7 @@ public class LOADTest extends SymbolAndFunctionCleaner { @Test 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)); assertNothingPrinted(); @@ -78,7 +78,7 @@ public class LOADTest extends SymbolAndFunctionCleaner { @Test 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)); assertErrorMessagePrinted(); @@ -94,7 +94,7 @@ public class LOADTest extends SymbolAndFunctionCleaner { @Test 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)); assertNothingPrinted(); @@ -102,7 +102,7 @@ public class LOADTest extends SymbolAndFunctionCleaner { @Test 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)); assertNothingPrinted(); @@ -125,7 +125,7 @@ public class LOADTest extends SymbolAndFunctionCleaner { @Test 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\")"; assertT(evaluateString(input)); diff --git a/src/test/java/interpreter/LispInterpreterTest.java b/src/test/java/interpreter/LispInterpreterTest.java index e1aee0e..b6987ee 100644 --- a/src/test/java/interpreter/LispInterpreterTest.java +++ b/src/test/java/interpreter/LispInterpreterTest.java @@ -165,7 +165,7 @@ public class LispInterpreterTest { @Test public void fileBasedInterpreterWorks_PrintsLastValueOnly() { setCommonFeatures(); - builder.useFile("src/test/interpreter/test-files/file.lisp"); + builder.useFile("src/test/resources/interpreter/file.lisp"); builder.build().interpret(); assertEquals("PICKLE\n\n", outputStream.toString()); diff --git a/src/test/java/application/test-files/file.lisp b/src/test/resources/application/file.lisp similarity index 100% rename from src/test/java/application/test-files/file.lisp rename to src/test/resources/application/file.lisp diff --git a/src/test/java/function/builtin/test-files/load-bad.lisp b/src/test/resources/function/builtin/load-bad.lisp similarity index 100% rename from src/test/java/function/builtin/test-files/load-bad.lisp rename to src/test/resources/function/builtin/load-bad.lisp diff --git a/src/test/java/function/builtin/test-files/load-good.lisp b/src/test/resources/function/builtin/load-good.lisp similarity index 100% rename from src/test/java/function/builtin/test-files/load-good.lisp rename to src/test/resources/function/builtin/load-good.lisp diff --git a/src/test/java/function/builtin/test-files/nested/included.lisp b/src/test/resources/function/builtin/nested/included.lisp similarity index 100% rename from src/test/java/function/builtin/test-files/nested/included.lisp rename to src/test/resources/function/builtin/nested/included.lisp diff --git a/src/test/java/function/builtin/test-files/nested/nested.lisp b/src/test/resources/function/builtin/nested/nested.lisp similarity index 100% rename from src/test/java/function/builtin/test-files/nested/nested.lisp rename to src/test/resources/function/builtin/nested/nested.lisp diff --git a/src/test/java/function/builtin/test-files/nested/one/load-one.lisp b/src/test/resources/function/builtin/nested/one/load-one.lisp similarity index 100% rename from src/test/java/function/builtin/test-files/nested/one/load-one.lisp rename to src/test/resources/function/builtin/nested/one/load-one.lisp diff --git a/src/test/java/function/builtin/test-files/nested/one/two/load-two.lisp b/src/test/resources/function/builtin/nested/one/two/load-two.lisp similarity index 100% rename from src/test/java/function/builtin/test-files/nested/one/two/load-two.lisp rename to src/test/resources/function/builtin/nested/one/two/load-two.lisp diff --git a/src/test/java/function/builtin/test-files/nested/one/two/three/load-three.lisp b/src/test/resources/function/builtin/nested/one/two/three/load-three.lisp similarity index 100% rename from src/test/java/function/builtin/test-files/nested/one/two/three/load-three.lisp rename to src/test/resources/function/builtin/nested/one/two/three/load-three.lisp diff --git a/src/test/java/interpreter/test-files/file.lisp b/src/test/resources/interpreter/file.lisp similarity index 100% rename from src/test/java/interpreter/test-files/file.lisp rename to src/test/resources/interpreter/file.lisp