This commit is contained in:
2026-07-08 12:09:57 +02:00
parent 87ae53d2f5
commit fe49f827ba
11 changed files with 50 additions and 35 deletions
+6 -6
View File
@@ -1,4 +1,4 @@
## termimg test verifies protocol detection, geometry, scaling,
## termimg test - verifies protocol detection, geometry, scaling,
## halfblock, quarterblock, dithering, and aspect-ratio preservation.
##
## Run: nim c -r --path:src tests/test_termimg.nim
@@ -250,7 +250,7 @@ when isMainModule:
echo " renderImageRaw returned ", outStr.len, " chars (no crash, pass)"
# ═══════════════════════════════════════════════════════════════
# ADVANCED VISUAL TESTS Gallery, columns, comparison grids
# ADVANCED VISUAL TESTS - Gallery, columns, comparison grids
# ═══════════════════════════════════════════════════════════════
# ── Pattern generators ────────────────────────────────────────
@@ -315,7 +315,7 @@ when isMainModule:
let rnb = rainbowBars(patternW, patternH)
let tgt = targetCircle(patternW, patternH)
# ── Test 17: Gallery three patterns side-by-side ────────────
# ── Test 17: Gallery - three patterns side-by-side ────────────
echo "\n── Test 17: Gallery (three patterns, same width) ──"
block:
let colW = (caps.columns - 4) div 3
@@ -347,7 +347,7 @@ when isMainModule:
echo " gallery: ", geo.columns, " cols each × ",
linesChk.len, " rows (3 across) (pass)"
# ── Test 18: Column layout same pattern at 3 densities ──────
# ── Test 18: Column layout - same pattern at 3 densities ──────
echo "\n── Test 18: Column layout (3 densities stacked) ──"
block:
let colW = caps.columns - 2
@@ -402,7 +402,7 @@ when isMainModule:
stdout.write(outW)
stdout.write("\n\n")
stdout.flushFile()
# Tall: swap dimensions (64x48 becomes 48x64 via the pattern? no use a tall pattern)
# Tall: swap dimensions (64x48 becomes 48x64 via the pattern? no - use a tall pattern)
let tallPixels = checkerboard(patternH, patternW, 6) # 48x64
var optsT = defaultOptions()
optsT.maxHeight = caps.rows - 4
@@ -446,7 +446,7 @@ when isMainModule:
# Exactly 1 byte extra (data.len == w*h*4 + 1)
let extra1 = newSeq[uint8](pw * ph * 4 + 1)
let out2 = renderImageRgba(extra1, pw, ph, caps, defaultOptions())
# Extra byte is harmless we only read w*h*4 from front
# Extra byte is harmless - we only read w*h*4 from front
doAssert out2.len > 0 or caps.protocols == {ptHalfBlock},
"1-byte-extra buffer should render normally (output len=" & $out2.len & ")"