Skip to content

Commit 4594ae6

Browse files
hyttijantmoo
authored andcommitted
Updated RPlugin class
1 parent 51a980f commit 4594ae6

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

tmc-langs-r/src/main/java/fi/helsinki/cs/tmc/langs/r/RPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private String[] getTestCommand() {
156156

157157
private String[] getAvailablePointsCommand() {
158158
String[] rscr = new String[] {"Rscript", "-e"};
159-
String[] command = new String[] {"\"library('tmcRtestrunner');"
159+
String[] command = new String[] {"\"library(tmcRtestrunner);"
160160
+ "getAvailablePoints(\"$PWD\")\""};
161161
return ArrayUtils.addAll(rscr, command);
162162
}

tmc-langs-r/src/main/java/fi/helsinki/cs/tmc/langs/r/RTestResultParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private TestResult toTestResult(JsonNode node) {
6767
backTrace.add(line.asText());
6868
}
6969

70-
boolean passed = node.get("status").asText().equals("passed");
70+
boolean passed = node.get("status").asText().equals("pass");
7171

7272
return new TestResult(
7373
node.get("name").asText(),

tmc-langs-r/src/main/java/fi/helsinki/cs/tmc/langs/r/TestMain.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@ public static void main(String[] args) {
2323

2424
//For now, add the path you want to test here fully,
2525
//for example: pathToGithubFolder/tmc-r/example_projects/example_project1
26-
26+
String exampleProjectLocation = "/example_projects/example_project1";
27+
Path path = Paths.get(exampleProjectLocation);
28+
RunResult runRes = runTests(path);
29+
printTestResult(runRes);
30+
RunResult rr;
2731

28-
/* try {
29-
rr = new RTestResultParser(path).parse();
30-
for (TestResult tr : rr.testResults) {
31-
System.out.println(tr.toString());
32-
}
33-
} catch (IOException e) {
34-
System.out.println("Something wrong: " + e.getMessage());
35-
}*/
3632
}
3733

3834
public static void printTestResult(RunResult rr) {

tmc-langs-r/src/test/java/fi/helsinki/cs/tmc/langs/r/RTestResultParserTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public void testThatParseSeemsToWorkOnExampleJson() {
3232
assertEquals(22, rr.testResults.size());
3333

3434
for (TestResult tr : rr.testResults) {
35-
System.out.println(tr);
3635
if (tr.getName().equals("Addition works")) {
3736
assertTrue(tr.isSuccessful());
3837
assertEquals(2, tr.points.size());

0 commit comments

Comments
 (0)