diff --git a/Compiler/src/Launcher.java b/Compiler/src/Launcher.java index e3b7062..3e452f1 100644 --- a/Compiler/src/Launcher.java +++ b/Compiler/src/Launcher.java @@ -29,8 +29,8 @@ public static void main(String... args) { System.exit(0); } - availableCompilers.put("Java", new JavaRunner()); - availableCompilers.put("Javascript", new JavascriptRunner()); + availableCompilers.put("java", new JavaRunner()); + availableCompilers.put("javascript", new JavascriptRunner()); File root = new File(FileSystems.getDefault().getPath("../").toAbsolutePath().toString()); @@ -45,8 +45,8 @@ public static void main(String... args) { } if(challenge != null) { - String wantedCompiler = args.length < 3 ? "Java" : args[2]; - Runner runner = availableCompilers.getOrDefault(wantedCompiler, availableCompilers.get("Java")); + String wantedCompiler = args.length < 3 ? "java" : args[2]; + Runner runner = availableCompilers.getOrDefault(wantedCompiler.toLowerCase(), availableCompilers.get("java")); CodeChecker codeChecker = runner.getCodeChecker(root, args[1]); diff --git a/Testing/Tests/Challenge_Four.json b/Testing/Tests/Challenge_Four.json index 173d2ef..bb0e99c 100644 --- a/Testing/Tests/Challenge_Four.json +++ b/Testing/Tests/Challenge_Four.json @@ -22,5 +22,8 @@ "expectedReturn": "grebmoolB" } ], - "initialCode": "public class Program {\n\tpublic Object run(String[] args) {\n\t\treturn \"reversed string\";\n\t}\n}" + "initialCode" : { + "java" : "public class Program {\n\tpublic Object run(String[] args) {\n\t\treturn \"reversedstring\";\n\t}\n}", + "javascript" : "function program(args) {\n\treturn \"reversedstring\";\n}" + } } \ No newline at end of file diff --git a/Testing/Tests/Challenge_One.json b/Testing/Tests/Challenge_One.json index e346d1d..6c4932a 100644 --- a/Testing/Tests/Challenge_One.json +++ b/Testing/Tests/Challenge_One.json @@ -18,5 +18,8 @@ "expectedReturn": 16 } ], - "initialCode": "public class Program {\n\tpublic Object run(String[] args) {\n\t\treturn -1;\n\t}\n}" + "initialCode" : { + "java" : "public class Program {\n\tpublic Object run(String[] args) {\n\t\treturn -1;\n\t}\n}", + "javascript" : "function program(args) {\n\treturn -1;\n}" + } } \ No newline at end of file diff --git a/Testing/Tests/Challenge_Three.json b/Testing/Tests/Challenge_Three.json index dff7926..d79c815 100644 --- a/Testing/Tests/Challenge_Three.json +++ b/Testing/Tests/Challenge_Three.json @@ -22,5 +22,8 @@ "expectedReturn": 0 } ], - "initialCode": "public class Program {\n\tpublic Object run(String[] args) {\n\t\treturn -1;\n\t}\n}" + "initialCode" : { + "java" : "public class Program {\n\tpublic Object run(String[] args) {\n\t\treturn -1;\n\t}\n}", + "javascript" : "function program(args) {\n\treturn -1;\n}" + } } \ No newline at end of file diff --git a/Testing/Tests/Challenge_Two.json b/Testing/Tests/Challenge_Two.json index 13029e3..5120a9d 100644 --- a/Testing/Tests/Challenge_Two.json +++ b/Testing/Tests/Challenge_Two.json @@ -18,5 +18,8 @@ "expectedReturn": 2 } ], - "initialCode": "public class Program {\n\tpublic Object run(String[] args) {\n\t\treturn -1;\n\t}\n}" + "initialCode" : { + "java" : "public class Program {\n\tpublic Object run(String[] args) {\n\t\treturn -1;\n\t}\n}", + "javascript" : "function program(args) {\n\treturn -1;\n}" + } } \ No newline at end of file