Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,7 @@ Yet another is that there is an internal error. The internal error message is:
}
prog = pretext + prog;
}
//any visible suffix already is included in editor code
if (useSuffix && this.suffix) {
prog = prog + this.suffix;
}
Expand Down
18 changes: 15 additions & 3 deletions bases/rsptx/interactives/runestone/activecode/js/livecode.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,21 @@ export default class LiveCode extends ActiveCode {
}
createErrorOutput() { }


getCombinedSuffixes() {
if (this.suffix && this.visibleSuffix)
return this.suffix + this.visibleSuffix;
else if (this.suffix)
return this.suffix;
else if (this.visibleSuffix)
return this.visibleSuffix;
return "";
}

hasUnitTests() {
return this.language === "java" && this.suffix && this.suffix.indexOf("import org.junit") > -1
|| this.language === "cpp" && this.suffix && this.suffix.indexOf("[doctest]") > -1;
let combinedSuffix = this.getCombinedSuffixes();
return this.language === "java" && combinedSuffix.indexOf("import org.junit") > -1
|| this.language === "cpp" && combinedSuffix.indexOf("doctest.h") > -1;
}

/* Main runProg method for livecode
Expand Down Expand Up @@ -491,7 +503,7 @@ export default class LiveCode extends ActiveCode {
let output = result.stdout ? result.stdout : "";
$(odiv).html(output);
}
if (this.suffix) {
if (this.hasUnitTests() || this.iotests) {
if (this.parsedOutput.pct === undefined) {
this.parsedOutput.pct =
this.parsedOutput.passed =
Expand Down