mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-14 16:35:03 +01:00
12 lines
328 B
TypeScript
12 lines
328 B
TypeScript
import { lines } from "./error";
|
|
|
|
it("should extract lines correctly", () => {
|
|
const input = "AAA\nmeow\n:3\n\n";
|
|
|
|
const lineSpans = lines({ content: input });
|
|
const lineContents = lineSpans.map(({ start, end }) =>
|
|
input.slice(start, end)
|
|
);
|
|
|
|
expect(lineContents).toStrictEqual(["AAA", "meow", ":3", "", ""]);
|
|
});
|