|
@@ -1,7 +1,6 @@
|
|
|
-import { Output } from './../io/output';
|
|
|
+import { Output } from "./../io/output";
|
|
|
|
|
|
export class OutputTest extends Output {
|
|
|
-
|
|
|
constructor () {
|
|
|
super();
|
|
|
this.list = [];
|
|
@@ -10,7 +9,7 @@ export class OutputTest extends Output {
|
|
|
|
|
|
write (text, newLine = false) {
|
|
|
if (this.currentLine == null) {
|
|
|
- this.currentLine = this.list.push('') - 1;
|
|
|
+ this.currentLine = this.list.push("") - 1;
|
|
|
}
|
|
|
|
|
|
this.list[this.currentLine] += text;
|
|
@@ -20,25 +19,22 @@ export class OutputTest extends Output {
|
|
|
}
|
|
|
|
|
|
sendOutput (text) {
|
|
|
- let output = '' + text;
|
|
|
- if (output.indexOf('\n') !== -1) {
|
|
|
- const outputList = output.split('\n');
|
|
|
- let last = outputList.pop();
|
|
|
- outputList.forEach( t => {
|
|
|
- t = t.replace(/\t/g, '  ');
|
|
|
- t = t.replace(/\s/g, " ");
|
|
|
- if (t.length == 0)
|
|
|
- this.currentLine = null;
|
|
|
- else
|
|
|
- this.write(t, true);
|
|
|
+ const output = "" + text;
|
|
|
+ if (output.indexOf("\n") !== -1) {
|
|
|
+ const outputList = output.split("\n");
|
|
|
+ const last = outputList.pop();
|
|
|
+ outputList.forEach((t) => {
|
|
|
+
|
|
|
+
|
|
|
+ if (t.length == 0) this.currentLine = null;
|
|
|
+ else this.write(t, true);
|
|
|
});
|
|
|
- last = last.replace(/\t/g, '  ');
|
|
|
- last = last.replace(/\s/g, " ");
|
|
|
- if (last.length != 0)
|
|
|
- this.write(last);
|
|
|
+
|
|
|
+
|
|
|
+ if (last.length != 0) this.write(last);
|
|
|
} else {
|
|
|
- output = output.replace(/\t/g, '  ');
|
|
|
- output = output.replace(/\s/g, " ");
|
|
|
+
|
|
|
+
|
|
|
this.write(output);
|
|
|
}
|
|
|
}
|