Initial commit

Signed-off-by: Ilan Bigio <ilan@openai.com>
This commit is contained in:
Ilan Bigio
2025-04-16 12:56:08 -04:00
commit 59a180ddec
163 changed files with 30587 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import TextBuffer from "../src/lib/text-buffer.js";
import { describe, it, expect } from "vitest";
describe("TextBuffer newline normalisation", () => {
it("insertStr should split on \r and \r\n sequences", () => {
const buf = new TextBuffer("");
// Windowsstyle CRLF
buf.insertStr("ab\r\ncd\r\nef");
expect(buf.getLines()).toEqual(["ab", "cd", "ef"]);
expect(buf.getCursor()).toEqual([2, 2]); // after 'f'
});
});