Add test for evaluating all portal scripts
This commit is contained in:
@@ -33,6 +33,10 @@ public class ScriptEvaluationTest {
|
|||||||
return getScriptFilePaths("npc");
|
return getScriptFilePaths("npc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static List<String> portalScriptFilePaths() throws IOException {
|
||||||
|
return getScriptFilePaths("portal");
|
||||||
|
}
|
||||||
|
|
||||||
private static List<String> getScriptFilePaths(final String scriptsSubdirectory) throws IOException {
|
private static List<String> getScriptFilePaths(final String scriptsSubdirectory) throws IOException {
|
||||||
Path scriptDirectory = Path.of("scripts", scriptsSubdirectory);
|
Path scriptDirectory = Path.of("scripts", scriptsSubdirectory);
|
||||||
try (Stream<Path> pathStream = Files.walk(scriptDirectory)) {
|
try (Stream<Path> pathStream = Files.walk(scriptDirectory)) {
|
||||||
@@ -66,4 +70,12 @@ public class ScriptEvaluationTest {
|
|||||||
|
|
||||||
assertNotNull(scriptEngine);
|
assertNotNull(scriptEngine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ParameterizedTest
|
||||||
|
@MethodSource("portalScriptFilePaths")
|
||||||
|
void portalScriptShouldEvaluate(String portalScriptPath) {
|
||||||
|
ScriptEngine scriptEngine = scriptManager.getInvocableScriptEngine(portalScriptPath);
|
||||||
|
|
||||||
|
assertNotNull(scriptEngine);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user