fn trim_trailing_blank_lines(output: &mut String)
Keep generated snapshots compatible with git diff --check by avoiding a trailing blank line at EOF while preserving the final newline.
git diff --check