This commit is contained in:
Steven Lucco 2017-02-22 10:41:02 -08:00
Родитель 0661ff8866
Коммит becec27259
1 изменённых файлов: 34 добавлений и 0 удалений

Просмотреть файл

@ -7,6 +7,7 @@ import * as RedBlack from "./redBlack";
import BTree from "./btree";
import * as random from "random-js";
import * as ITree from "./intervalSpanningTree";
import * as CollabString from "./ops";
function compareStrings(a: string, b: string) {
return a.localeCompare(b);
@ -420,6 +421,39 @@ function itreeCheckedTest() {
}
class TestClient {
constructor(public id: number, public text:string, public testService: TestService) {
}
testInsert(pos: number, s: string) {
}
}
class TestService {
todoIndex = 0;
ops: CollabString.Op[] = [];
clients: TestClient[] = [];
msg(op: CollabString.Op) {
this.ops.push(op);
this.process();
}
process() {
let outOps: CollabString.Op[]=[];
for (let i=this.todoIndex, len = this.ops.length;i<len;i++) {
let op = this.ops[i];
if (i>this.todoIndex) {
}
else {
outOps.push(op);
}
}
}
}
//simpleTest();
//fileTest1();