some stuff

This commit is contained in:
nora 2023-07-23 11:51:59 +02:00
parent ef32e646d6
commit 91b183c002
11 changed files with 4320 additions and 101 deletions

12
src/error.test.ts Normal file
View file

@ -0,0 +1,12 @@
import { Span, lines } from "./error";
it("should extract lines correctly", () => {
const input = "AAA\nmeow\n:3\n\n";
const lineSpans = lines(input);
const lineContents = lineSpans.map(({ start, end }) =>
input.slice(start, end)
);
expect(lineContents).toStrictEqual(["AAA", "meow", ":3", "", ""]);
});