mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 08:55:04 +01:00
some stuff
This commit is contained in:
parent
ef32e646d6
commit
91b183c002
11 changed files with 4320 additions and 101 deletions
12
src/error.test.ts
Normal file
12
src/error.test.ts
Normal 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", "", ""]);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue