Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/sanitize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,12 @@ mod tests {

#[test]
fn test_sanitize_preserves_markdown_headings() {
// Markdown headings and bare issue references must not be neutralized.
// A bare "#123" (without a preceding bot keyword like "fixes") must NOT
// be wrapped in backticks — this assertion would pass even if "#123"
// were wrapped, so we assert the exact output instead.
let input = "# Heading\n## Sub-heading\nIssue #123";
let result = sanitize(input);
assert!(result.contains("# Heading"));
assert!(result.contains("## Sub-heading"));
assert!(result.contains("#123"));
assert_eq!(sanitize(input), input);
}

// ── sanitize_config tests ─────────────────────────────────────────────
Expand Down Expand Up @@ -622,8 +623,10 @@ mod tests {

#[test]
fn test_sanitize_config_removes_control_chars() {
let input = "hello\x00world\x07!";
assert_eq!(sanitize_config(input), "helloworld!");
// ANSI escape sequences must be stripped through the config pipeline.
// "\x1b[0m" is the ANSI reset code; it should be removed, joining "val" and "ue".
let input = "val\x1b[0mue";
assert_eq!(sanitize_config(input), "value");
}

#[test]
Expand Down