Dezio/docs/tests/S004-caption.md
2026-12-01 22:50:24 -06:00

32 lines
2.2 KiB
Markdown

# S004 — /caption checks
Run in Discord (owner) unless noted. Bot must have the S004 build.
## Doubts
- Video path never run: needs ffmpeg with libx264 on the server; check `ffmpeg -encoders | grep libx264` there.
- Band height unit test depends on the font in `assets/` (missing in worktrees).
- Slash option names with hyphens (`source-attachment`) never registered with Discord yet.
## Checks
1. `/image` and `D!fx` no longer exist (slash list, `D!help`).
2. `/caption text:hello` with a PNG attached: PNG back, white band with centred black text above, same width.
3. Same with a JPG and a still WebP: works.
4. GIF attached: GIF back, still animated, every frame has the band.
5. Animated WebP: comes back as an animated GIF.
6. MP4, WebM and MOV: MP4 back that plays in Discord, band on top, no sound, at most about 10 s.
7. `/caption source-link:<public image link> text:hi`: works.
8. `D!caption hi` replying to a picture: works. `D!caption hi <link>`: works.
9. `/caption text:hi` with no source after someone posted a picture: uses that picture.
10. Empty text (`D!caption` alone, `/caption text:` blank): clear error card, no upload.
11. Text of 600 characters: "too long" error. Text of about 200 characters: band grows, still readable.
12. Multi-line text: band is as tall as the lines need (3 lines taller than 1).
13. Huge input (over 15 MB): "couldn't download" card, no hang.
14. Bad link (`http://127.0.0.1/x`, `not a link`): error card, no crash.
15. Non-media file (a PDF or audio only): "none of those" error.
16. Result over the upload budget: smaller retry, else "too big" card.
17. `cargo test band_height caption_keeps` passes where assets exist; help-limits test passes.
## Results (S010, 2026-12-01)
- 1 pass (no `fx` command; `cargo test` registry/help tests pass). 2 pass, 4 pass (rendered by a test: PNG gets a white band + text, GIF keeps 2+ frames, contact sheet looked at). 12, 17 pass (`band_height_grows_with_lines_and_is_even`, `caption_keeps_picture_kind`, help limits).
- 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 3: not run: need Discord or a live bot (owner, S011). Video path not run here either.
- Doubt libx264: ffmpeg on this PC has the same helper tests passing (`ffmpeg.rs` mp4 tests); the server's ffmpeg not checked.