Claude's answers, rendered: Markdown, math, charts and diagrams drawn in the Claude Code terminal. Independent project, not affiliated with Anthropic.
TypeScript claude-code-mod
Pages: the gap between two blocks at a page break
razorback162a0e110916c8
diff --git a/docs/development.md b/docs/development.mdindex 4222347..639cbd2 100644--- a/docs/development.md+++ b/docs/development.md@@ -14,6 +14,7 @@ sh tests/cache-sh-test.sh # the cache folder sweep (CACHE_SH) in sh, dash ash tests/fonts-sh-test.sh # the copy of a font out of a terminal's program (PROGRAM_FONTS_SH and _PL) with perlsh tests/bold-sh-test.sh # the fake bold of md.typ (term-bold=0) with the real Typst and Monaco (skips with no Monaco)sh tests/code-sh-test.sh # code blocks of md.typ (width, header, copy button mark, row grid) with the real Typst (skips with no typst)+sh tests/gap-sh-test.sh # the gap at a page break of md.typ (seams), on and off the row grid, with the real Typst (skips with no typst)sh tests/herdr-sh-test.sh # the herdr client finder (HERDR_CLIENT_SH) with fake ps, stat and lsof, in sh, dash and bashclaude plugin validate .```diff --git a/docs/how-it-works.md b/docs/how-it-works.mdindex 7c86b61..df05095 100644--- a/docs/how-it-works.md+++ b/docs/how-it-works.md@@ -5,7 +5,7 @@## The steps1. A `ui.render` hook on `AssistantMessage` gets each block of the answer as Markdown.-2. While Claude writes a block, Claude Code shows its own text: Claude Code gives the hook the text of a block only when the block is complete (versions 2.1.299 to 2.1.303 at least). The block is final when the model request starts its next block (a tool call, more text) or ends. If the mod did not see the request, the block is final after its text stops changing for 400 ms. Then the mod writes the block to a JSON file and runs `typst compile` with `render/md.typ`. For plain text, Typst loads only some fonts (refer to [The lean font set](#the-lean-font-set)). Long answers are cut at block boundaries into pages. One page is one PNG.+2. While Claude writes a block, Claude Code shows its own text: Claude Code gives the hook the text of a block only when the block is complete (versions 2.1.299 to 2.1.303 at least). The block is final when the model request starts its next block (a tool call, more text) or ends. If the mod did not see the request, the block is final after its text stops changing for 400 ms. Then the mod writes the block to a JSON file and runs `typst compile` with `render/md.typ`. For plain text, Typst loads only some fonts (refer to [The lean font set](#the-lean-font-set)). Long answers are cut at block boundaries into pages. One page is one PNG. The pages show one under the other with no space between them. Thus each page after the first starts with the space that its first block has under the last block of the page above it. The JSON file holds these two blocks for each cut, and Typst measures the space. On the row grid, this space is the same as in one page.3. The hook draws one `Image` per PNG, in place of the text.4. Text size: the mod finds the terminal font (iTerm2 profile, Ghostty, kitty or Rio config; on Linux, else fontconfig's `monospace` font; else the metrics of the theme's code font, Menlo on macOS) and the cell size in pixels. Typst then measures both fonts so that 100% looks as large as the terminal text. Body text and code use the terminal font, so at 100% they are exactly the terminal's size. The mod uses the font that the terminal draws: if the config names a font that is not installed, the terminal draws a different font, and the mod uses that font too (Ghostty and cmux on macOS, and Rio: their own font; Ghostty on Linux and kitty on Linux: the nearest font of fontconfig; kitty on macOS: Menlo; iTerm2: the user's fixed-pitch font, Menlo if you did not change it). If Ghostty's `font-family` is a list, the mod uses the first font of the list that is installed. Ghostty and cmux draw their own JetBrains Mono when their config names no font. Rio draws its own Cascadia Code NF when its config names no font (or `cascadiacode`). These fonts are not files: they are inside the program of the terminal. The first time, the mod copies the font to `~/.cache/cc-intelligent-ui/fonts/` (approximately 0.1 s for Ghostty and 0.5 s for Rio, once for each version of the terminal), so that Typst can draw it. If you set the `TYPST_FONT_PATHS` variable, Typst gets your folders and the copy. If the mod cannot copy Rio's font, it uses Cascadia Code if it is installed. If Typst does not have the terminal font, `/iui details` tells you, and the pictures use the theme's fonts. If the terminal font has no bold face (for example, Monaco), the pictures draw its bold text with a thin outline in the text colour (a fake bold, as a terminal draws it). The mod finds this with `typst fonts --variants` when it measures the fonts. In Ghostty and cmux, the mod also removes the window padding from the cell size, because Ghostty adds the padding to the pixel size that it reports.5. If a compile fails (a bad Typst block or an unknown LaTeX command), the mod compiles once more in safe mode: Typst blocks and math show as code. A dim line under the picture names the error. If that also fails, the normal text shows.diff --git a/docs/limitations.md b/docs/limitations.mdindex ec4039b..18c846e 100644--- a/docs/limitations.md+++ b/docs/limitations.md@@ -49,6 +49,7 @@- When a line of body text uses 2 rows, the rules of a table, display math, an image, a Typst drawing and a horizontal rule are half a row down. The text stays in the middle of the rows.- A level-4 to level-6 heading at 100% (and a level-3 or level-4 heading at approximately 117%) has the same gap above it and below it (1 row), because the two gaps are nearest to 1 row.- If inline math makes the first line of an answer taller, the reply bullet can be one row above the text.+- **Without the row grid** (`/iui grid off`), the space between two blocks where a long answer goes to its next page can be up to one row larger than in one page, because each page is a number of full rows.- **Search does not find text in a picture.**- **While Claude writes**, Claude Code shows its own text of the block (raw Markdown, for example `$…$` math as text), because Claude Code gives a mod the text of a block only when the block is complete. Then the block is blank until its picture is ready: approximately 0.03–0.07 s for plain text (refer to [The lean font set](how-it-works.md#the-lean-font-set)), 0.15–0.6 s for other text, and 2–3 s for a large Typst drawing. If the picture is not ready 2 s after the block is complete, the normal text shows until the picture is ready. If the compile fails, the normal text stays. An earlier answer that is not in the cache (for example, after a resume) is blank for up to 1 s, then shows as text until its picture is ready.- **Short summaries** between tool calls stay as text.diff --git a/hooks/lib/markdown.ts b/hooks/lib/markdown.tsindex c7da41b..9f3c12b 100644--- a/hooks/lib/markdown.ts+++ b/hooks/lib/markdown.ts@@ -122,6 +122,23 @@ export function splitSegments(md: string, columns: number, budget = SEGMENT_ROWSreturn texts.map(t => `${t}\n\n${defs.filter(d => !t.includes(d)).join('\n')}`.trimEnd())}+// The blocks at each break between segments, for the gap the template puts+// there: the last block above the break and the first below it (a fence as+// a short one of its kind, a typst fence with no code; link definitions are+// no block). Null for the first segment and where a side has no block.+export function seamsOf(segments: readonly string[]): ([string, string] | null)[] {+ const short = (block: Block) => {+ const { fence } = block+ if (!fence) return block.lines.join('\n')+ return [block.lines[0]!, ...(isTypstInfo(fence.info) ? [] : ['x']), fence.mark].join('\n')+ }+ const ends = segments.map(seg => blocksOf(seg).filter(b => b.fence || !b.lines.every(line => LINK_DEF.test(line))))+ return ends.map((blocks, i) => {+ const above = ends[i - 1]?.at(-1)+ return above && blocks.length ? [short(above), short(blocks[0]!)] : null+ })+}+// A segment whose page came out taller than an Image can be, cut in two by// the same rules (at half its rows); one piece when it can not be cut.export function splitInTwo(md: string, columns: number, size = 100, roomRows = DRAWING_ROWS): string[] {diff --git a/hooks/lib/typst.ts b/hooks/lib/typst.tsindex 8478bff..a8d7691 100644--- a/hooks/lib/typst.ts+++ b/hooks/lib/typst.ts@@ -4,7 +4,7 @@ import type { EngineInterface } from 'claude-code'import { COMPILE_TIMEOUT_MS, MAX_IMAGE_ROWS, NO_NETWORK, TOUCH_FLUSH_MS, TYPST_FALLBACKS } from './settings'import { DEFAULT_METRICS, fauxBoldOf, S, type Cell, type FontMetrics, type Job, type LeanFonts, type Metrics, type Page, type Result } from './state'-import { firstLine, imagePathOf, localImages, plainOf, splitInTwo, splitSegments } from './markdown'+import { firstLine, imagePathOf, localImages, plainOf, seamsOf, splitInTwo, splitSegments } from './markdown'import { segmentBudget } from './terminal'import { fontFit, placeFirstLine, sizing } from './draw'import { DEFAULT_GRID, gridOf } from './grid'@@ -451,6 +451,11 @@ async function pagesOfRun($: EngineInterface, job: Job, dir: string, tag: string}))}+// The doc JSON of a compile: with the seams (the gaps at the breaks) when+// there is more than one segment.+const docOf = (base: string, segments: readonly string[], images: readonly string[]) =>+ JSON.stringify({ base, segments, images, ...(segments.length > 1 ? { seams: seamsOf(segments) } : {}) })+// Compiles a job's text to its pages (kept in its key folder). `signal`// stops it: a run killed by it, or a retry not begun, is 'cancelled' (not a// result: nothing is kept).@@ -471,7 +476,7 @@ export async function compile($: EngineInterface, job: Job, signal?: AbortSignallet segments = splitSegments(job.text, job.columns, segmentBudget(job.env, job.columns, job.cell), job.size, roomRows)const base = job.base ?? job.env.cwdconst images = await existingImages($, segments, base)- await fsWrite($, `${dir}/doc.json`, JSON.stringify({ base, segments, images }))+ await fsWrite($, `${dir}/doc.json`, docOf(base, segments, images))let tag = 'a'let isSafe = false@@ -502,7 +507,7 @@ export async function compile($: EngineInterface, job: Job, signal?: AbortSignalconst cut = segments.flatMap((seg, i) => (pages![i]!.rows > MAX_IMAGE_ROWS ? splitInTwo(seg, job.columns, job.size, roomRows) : [seg]))if (cut.length > segments.length) {if (signal?.aborted) return 'cancelled'- await fsWrite($, `${dir}/doc.json`, JSON.stringify({ base, segments: cut, images }))+ await fsWrite($, `${dir}/doc.json`, docOf(base, cut, images))const again = await runTypst($, job, cut, dir, isSafe ? 'd' : 'c', isSafe, signal)if (again.isCancelled) return 'cancelled'const split = again.exitCode === 0 ? await pagesOfRun($, job, dir, isSafe ? 'd' : 'c', cut) : nulldiff --git a/render/md.typ b/render/md.typindex 16c519b..44915db 100644--- a/render/md.typ+++ b/render/md.typ@@ -34,7 +34,11 @@// (never larger than f); a tall block is never made smaller (the page grows).//// doc JSON: { "base": "/dir/for/relative/images", "segments": ["md", ...],-// "images": ["/abs/path.png", ...] (optional allow-list) }+// "images": ["/abs/path.png", ...] (optional allow-list),+// "seams": [null, ["md above", "md below"], ...] (optional) }+// seams: for each segment after the first, the block above its break (the+// last of the segment before) and its own first block. The page starts with+// the gap these two blocks have in one flow (pages are drawn with no gap).//// safe=1: the retry mode after a failed compile. `typst` fences are shown as// code (no eval), math is shown as code (no mitex), images are alt boxes.@@ -107,6 +111,8 @@#let segments = doc.at("segments", default: ())#if type(segments) == str { segments = (segments,) }#if segments.len() == 0 { segments = ("",) }+#let seams = doc.at("seams", default: none)+#if type(seams) != array { seams = () }// ---------- theme ----------// Colours, fonts and element sizes come from the active theme@@ -1227,17 +1233,36 @@// footnote entries, which a page lays out, have them too.#show: body => if on-grid { grid-rules(body) } else { body }+// The two blocks of a seam as one flow less each alone: the gap between+// them (needs context). Its own label prefix, so no label is used twice.+#let seam-gap(seam) = {+ let h(md) = {+ let body = render-md(md, "seam")+ measure(block(width: content-w, if on-grid { heading-gaps(body) } else { body })).height+ }+ let (above, below) = seam.map(str)+ h(above + "\n\n" + below) - h(above) - h(below)+}+#for (i, seg) in segments.enumerate() {if only > 0 and i + 1 != only { continue }let md = if type(seg) == str { seg } else { str(seg) }+ let seam = seams.at(i, default: none)+ let seam = if i > 0 and type(seam) == array and seam.len() == 2 { seam } else { none }let body = render-md(md, i)- if on-grid { body = heading-gaps(body, page: true) }+ // A page that continues the text has no heading row taken away at its top+ // (its gap above, from the seam, is the flow's).+ if on-grid { body = heading-gaps(body, page: seam == none) }if notes-before > 0 { body = { counter(footnote).update(notes-before); body } }// Pad the bottom so the page is a whole number of terminal rows.context {// On the grid, every page starts on a row (no top margin), or half a// row lower when the flow has the half-row phase (grid-rules).- let top = if on-grid { if flow-half() { row / 2 } else { 0pt } } else if i == 0 { first-top } else { margin-y }+ let half = on-grid and flow-half()+ let top = if on-grid { if half { row / 2 } else { 0pt } } else if i == 0 { first-top } else if seam != none { 0pt } else { margin-y }+ // A page that continues the text: the seam's gap above its first block,+ // less the half rows of this page's top and of the page above's bottom.+ let body = if seam == none { body } else { v(seam-gap(seam) - if half { row } else { 0pt }); body }// No bottom margin: text is measured to its descenders, so the last line// ends the page and the next row is the engine's own gap.let total = top + measure(block(width: content-w, body)).heightdiff --git a/tests/gap-sh-test.sh b/tests/gap-sh-test.shnew file mode 100644index 0000000..894a52f--- /dev/null+++ b/tests/gap-sh-test.sh@@ -0,0 +1,92 @@+#!/bin/sh+# Renders Markdown with render/md.typ and the real Typst, once as one page+# and once cut into pages at its blocks (with the seams that compile writes+# in doc.json), and compares where each line is with the pages one under+# the other: on the row grid (both phases) a page that continues the text+# starts with the gap the blocks have in one page, so each line is where it+# is in one page; off the grid each line is at most one row lower for each+# break (a page is padded to whole rows). It keeps the PNGs in $IUI_GAP_OUT+# when that is set, to look at.+# Usage: sh tests/gap-sh-test.sh (exit 0 when all pass; skips with no typst)+set -u+here=$(cd "$(dirname "$0")/.." && pwd)+tmp=$(mktemp -d "${TMPDIR:-/tmp}/iui-gap-test.XXXXXX")+trap 'rm -rf "$tmp"' EXIT+pass=0+fail=0+ok() { pass=$((pass + 1)); }+bad() { fail=$((fail + 1)); echo "FAIL: $*"; }++command -v typst >/dev/null 2>&1 || { echo "gap-sh-test: skipped (no typst)"; exit 0; }++# Doc JSONs from the Markdown on stdin (blocks between blank lines, no+# fence with a blank line): $tmp/<name>-one.json (one segment) and+# $tmp/<name>-cut.json (one segment for each block, with its seams).+docs() {+ perl -e 'local $/; my $m = <STDIN>; $m =~ s/\n+$//; my @b = split /\n\n+/, $m;+ my $q = sub { my $s = shift; $s =~ s/(["\\])/\\$1/g; $s =~ s/\n/\\n/g; "\"$s\"" };+ open my $one, ">", "$ARGV[0]-one.json"; print $one "{\"base\": \"\", \"segments\": [" . $q->($m) . "]}";+ my @seams = ("null", map { "[" . $q->($b[$_ - 1]) . ", " . $q->($b[$_]) . "]" } 1 .. $#b);+ open my $cut, ">", "$ARGV[0]-cut.json"; print $cut "{\"base\": \"\", \"segments\": [" . join(", ", map { $q->($_) } @b) . "], \"seams\": [" . join(", ", @seams) . "]}"' "$tmp/$1"+}+# The inputs of doc $1 with row $2, grid $3 (1 on, 0 off).+inputs() {+ echo "--input theme=dark --input width=420 --input top=4 --input code=0.9 --input theme-dir=$here/render/themes/claude-code --input doc=$1 --input row=$2"+ [ "$3" = 0 ] || echo "--input grid=1"+}+# The y of each line (its first mark), the pages one under the other, of+# doc $1 (row $2, grid $3) at $1.lines: the page heights from the PNGs (at+# 720 ppi: 0.1 pt), the marks from the probe.+lines() {+ rm -f "$1".*.png+ # shellcheck disable=SC2046+ typst compile --root / --package-path "$here/render/packages" --format png --ppi 720 $(inputs "$1.json" "$2" "$3") "$here/render/md.typ" "$1.{0p}.png" 2> "$tmp/err" \+ && typst query --root / --package-path "$here/render/packages" $(inputs "$1.json" "$2" "$3") --input probe=1 "$here/render/md.typ" '<mdpos>' --field value > "$1.marks" 2> "$tmp/err" \+ || { bad "typst for $(basename "$1") (row $2, grid $3): $(grep -A3 '^error' "$tmp/err" | head -4)"; return 1; }+ perl -MJSON::PP -e 'my $marks = shift;+ my @h = map { open my $f, "<:raw", $_; read $f, my $b, 24; (unpack "x20 N", $b) / 10 } sort { ($a =~ /(\d+)\.png$/)[0] <=> ($b =~ /(\d+)\.png$/)[0] } @ARGV;+ my @off = (0); push @off, $off[-1] + $_ for @h;+ local $/; open my $m, "<", $marks; my @m = @{decode_json(<$m>)}; my %seen;+ for my $x (grep { $_->{k} eq "w" or $_->{k} eq "c" } @m) { my $y = $x->{y} + $off[$x->{p} - 1]; next if $seen{sprintf "%.0f", $y}++; printf "%.2f %d %.2f %s\n", $y, $x->{p}, $x->{y}, $x->{k} eq "c" ? "code" : $x->{t} }' "$1.marks" "$1".*.png > "$1.lines"+ ok+}+# Compares the lines of $1-one and $1-cut (row $2, grid $3): the same+# lines; on the grid each at the same y (to 0.15 pt), off the grid each at+# most one row lower for each break above it.+same() {+ lines "$tmp/$1-one" "$2" "$3" && lines "$tmp/$1-cut" "$2" "$3" || return+ out=$(paste -d ' ' "$tmp/$1-one.lines" "$tmp/$1-cut.lines" | perl -ne 'my ($y1, $p1, $r1, $t1, $y2, $p2, $r2, $t2) = split;+ print "$t1 / $t2\n" if $t1 ne $t2; my $d = $y2 - $y1;+ if ('"$3"') { print "$t1 at $y1, cut $y2\n" if abs($d) > 0.15 } else { print "$t1 at $y1, cut $y2\n" if $d < -0.15 or $d > ($p2 - 1) * '"$2"' + 0.15 }')+ [ "$(wc -l < "$tmp/$1-one.lines")" = "$(wc -l < "$tmp/$1-cut.lines")" ] || out="lines: $(wc -l < "$tmp/$1-one.lines") and $(wc -l < "$tmp/$1-cut.lines") $out"+ [ -z "$out" ] && ok || bad "$1 (row $2, grid $3): $out"+}++# The case that was seen: a list on the page under a paragraph.+printf '## 1. What Is a GPU?\n\nJust as $E=mc^2$ a paragraph that ends here.\n\n- **Fixed-function era:** item one\n- item two\n' | docs list+# Other blocks at a break: a heading of each phase, code, a quote, a+# table, display math, a numbered list, a rule.+printf '# A Field Guide\n\n### Three\n\nText under it.\n\n```sh\necho hi\n```\n\n> A quote.\n\n| a | b |\n|---|---|\n| 1 | 2 |\n\n## Two\n\n$$\nx^2 + y^2\n$$\n\n1. one\n2. two\n\n---\n\nLast.\n' | docs mixed+# 13.2: one row a line; 11.6331: another font size; 7: two rows a line+# (the half-row phase).+for row in 13.2 11.6331 7; do+ same list "$row" 1+ same mixed "$row" 1+done+same list 13.2 0+same mixed 13.2 0++# The page under the break starts with the blank row (grid, one row a+# line): the list's first line is a row down, not at the page's top.+lines "$tmp/list-cut" 13.2 1 && {+ out=$(perl -ne 'my ($y, $p, $r, $t) = split; print "page 3 starts at $r\n" if $p == 3 and !$s++ and $r < 13.2' "$tmp/list-cut.lines")+ [ -z "$out" ] && ok || bad "the blank row at the break: $out"+}++# PNGs to look at.+if [ -n "${IUI_GAP_OUT:-}" ]; then+ mkdir -p "$IUI_GAP_OUT"+ cp "$tmp"/*.png "$IUI_GAP_OUT/" 2>/dev/null+fi+echo "gap-sh-test: $pass passed, $fail failed"+[ "$fail" = 0 ]diff --git a/tests/pure.test.ts b/tests/pure.test.tsindex 021e13e..de71d35 100644--- a/tests/pure.test.ts+++ b/tests/pure.test.ts@@ -13,6 +13,7 @@ import {firstLine, gridText, heightText, isTypstInfo, widthText,} from '../hooks/register'import { DRAWING_ROWS } from '../hooks/lib/settings'+import { seamsOf } from '../hooks/lib/markdown'import { noNetworkEnv, wrapPid } from '../hooks/lib/typst'import { S, type Env, type Job } from '../hooks/lib/state'import { placeFirstLine } from '../hooks/lib/draw'@@ -114,6 +115,31 @@ test('footnotes keep the answer in one segment; link definitions go to every segfor (const s of segments) expect(s.includes('[docs]: https://example.com')).toBe(true)})+test('a seam is the block above a break and the block below it', () => {+ expect(seamsOf(['# T\n\nA paragraph.', '- a\n- b\n\nAfter.'])).toEqual([null, ['A paragraph.', '- a\n- b']])+ expect(seamsOf(['One segment.'])).toEqual([null])+ expect(seamsOf(['', 'Text.'])).toEqual([null, null])+ // A fence is a short one of its kind, a typst fence has no code.+ expect(seamsOf([fence('python', 50), '```typst\n#rect()\n```', 'End.'])).toEqual([null, ['```python\nx\n```', '```typst\n```'], ['```typst\n```', 'End.']])+ // Link definitions are no block.+ expect(seamsOf(['Text.\n\n[d]: https://e.com', 'More.\n\n[d]: https://e.com'])).toEqual([null, ['Text.', 'More.']])+})++test('the seams of a split answer are the blocks that meet at its breaks', () => {+ const md = Array.from({ length: 120 }, (_, i) => (i % 3 ? para(i) : `- item ${i}\n- more ${i}`)).join('\n\n')+ const segments = splitSegments(md, 80, 30)+ const seams = seamsOf(segments)+ expect(segments.length).toBeGreaterThan(2)+ expect(seams[0]).toBeNull()+ for (const [i, seam] of seams.entries()) {+ if (!i) continue+ expect(segments[i - 1]!.endsWith(seam![0])).toBe(true)+ expect(segments[i]!.startsWith(seam![1])).toBe(true)+ // In the text the two blocks meet as they are.+ expect(md.includes(`${seam![0]}\n\n${seam![1]}`)).toBe(true)+ }+})+test('the hash is stable and tells inputs apart', () => {expect(hashOf(['abc', 100])).toBe(hashOf(['abc', 100]))expect(hashOf(['abc', 100])).not.toBe(hashOf(['abc', 101]))diff --git a/tests/stream.test.ts b/tests/stream.test.tsindex b663b14..8a88b5b 100644--- a/tests/stream.test.ts+++ b/tests/stream.test.ts@@ -214,7 +214,7 @@ test('a diagram keeps its design only after its final text compiled, never while})test('a page over 255 rows: its segment is cut in two and compiled once more', async ($, on) => {- const { clock, counts } = world(on, { tall: true })+ const { clock, counts, files } = world(on, { tall: true })on('ui.render', () => ENGINE as any)await $.command.run({ command: 'iui', args: '' } as any)const text = Array.from({ length: 12 }, (_, i) => `Paragraph ${i} ${'word '.repeat(40)}`.trim()).join('\n\n')@@ -222,6 +222,9 @@ test('a page over 255 rows: its segment is cut in two and compiled once more', aawait clock.settle()await ui.redraw(props(text))expect(counts).toEqual([1, 2])+ // The retry's doc has the seam at its break (the gap there).+ const doc = JSON.parse([...files].find(([path]) => path.endsWith('/doc.json'))![1])+ expect(doc.seams).toEqual([null, [doc.segments[0].split('\n\n').at(-1), doc.segments[1].split('\n\n')[0]]])const pages = images(await ui.drawn())expect(pages.length).toBe(2)expect(pages.map(p => p.props.source.file.replace(/^.*\//, ''))).toEqual(['c-1.png', 'c-2.png'])