Skip to content

Commit 033ef6d

Browse files
committed
test: prefer-let and lint-clean graphics suite
1 parent 36c03fc commit 033ef6d

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

‎test/graphics.test.ts‎

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
* One spec, one test file. */
33

44
import { createInput } from "../input.ts";
5-
import {
6-
close,
7-
img,
8-
type ImgProps,
9-
type Op,
10-
open,
11-
type SizingAxis,
12-
} from "../ops.ts";
5+
import { close, img, type Op, open, type SizingAxis } from "../ops.ts";
136
import { createTerm } from "../term.ts";
14-
import { describe, expect, it } from "./suite.ts";
7+
import { describe, it } from "./suite.ts";
158
import { print } from "./print.ts";
169

1710
const KITTY_GRANT = {
@@ -31,7 +24,7 @@ function solid(w: number, h: number, rgb: [number, number, number]): {
3124
height: number;
3225
pixels: Uint8Array;
3326
} {
34-
const pixels = new Uint8Array(w * h * 4);
27+
let pixels = new Uint8Array(w * h * 4);
3528
for (let i = 0; i < pixels.length; i += 4) {
3629
pixels[i] = rgb[0];
3730
pixels[i + 1] = rgb[1];
@@ -51,14 +44,10 @@ function frame(t: Awaited<ReturnType<typeof term>>, ops: Op[]): string {
5144
}
5245

5346
function grid(t: Awaited<ReturnType<typeof term>>, ops: Op[]): string[] {
54-
const text = print(frame(t, ops), 40, 12);
47+
let text = print(frame(t, ops), 40, 12);
5548
return text.split("\n");
5649
}
5750

58-
function stripApc(s: string): string {
59-
return s.replace(/\x1b_G[^\x1b]*\x1b\\/g, "");
60-
}
61-
6251
describe("graphics: tier resolution", () => {
6352
it("renders ascii art without evidence (auto ladder)", async () => {
6453
let t = await term();
@@ -389,6 +378,7 @@ describe("graphics: registry API", () => {
389378
let out = frame(t, [img("a", { image: 1, alt: "x" })]);
390379
// INV-I5's claim is about the graphics frames themselves: fed to the
391380
// input parser, an APC frame generates no responses of any kind
381+
// deno-lint-ignore no-control-regex
392382
let apc = out.match(/\x1b_G[^\x1b]*\x1b\\/g) ?? [];
393383
if (apc.length === 0) throw new Error("no APC frames to test");
394384
let input = await createInput();

0 commit comments

Comments
 (0)