Add test for evaluating all item scripts
This commit is contained in:
@@ -21,14 +21,18 @@ public class ScriptEvaluationTest {
|
||||
System.setProperty("polyglot.engine.WarnInterpreterOnly", "false");
|
||||
}
|
||||
|
||||
private static List<String> npcScriptFilePaths() throws IOException {
|
||||
return getScriptFilePaths("npc");
|
||||
}
|
||||
|
||||
private static List<String> eventScriptFilePaths() throws IOException {
|
||||
return getScriptFilePaths("event");
|
||||
}
|
||||
|
||||
private static List<String> itemScriptFilePaths() throws IOException {
|
||||
return getScriptFilePaths("item");
|
||||
}
|
||||
|
||||
private static List<String> npcScriptFilePaths() throws IOException {
|
||||
return getScriptFilePaths("npc");
|
||||
}
|
||||
|
||||
private static List<String> getScriptFilePaths(final String scriptsSubdirectory) throws IOException {
|
||||
Path scriptDirectory = Path.of("scripts", scriptsSubdirectory);
|
||||
try (Stream<Path> pathStream = Files.walk(scriptDirectory)) {
|
||||
@@ -47,6 +51,14 @@ public class ScriptEvaluationTest {
|
||||
assertNotNull(scriptEngine);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("itemScriptFilePaths")
|
||||
void itemScriptShouldEvaluate(String itemScriptPath) {
|
||||
ScriptEngine scriptEngine = scriptManager.getInvocableScriptEngine(itemScriptPath);
|
||||
|
||||
assertNotNull(scriptEngine);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("npcScriptFilePaths")
|
||||
void npcScriptShouldEvaluate(String npcScriptPath) {
|
||||
|
||||
Reference in New Issue
Block a user