use crate::channels::telegram::handler::md_to_html;
#[test]
fn double_asterisk_bold_no_longer_empties() {
assert_eq!(md_to_html("**ask**"), "<b>ask</b>");
assert_eq!(
md_to_html("Set by **auto-always** default"),
"Set by <b>auto-always</b> default"
);
}
#[test]
fn single_asterisk_bold_still_works() {
assert_eq!(md_to_html("*bold*"), "<b>bold</b>");
}
#[test]
fn inline_code_and_escaping() {
assert_eq!(md_to_html("`x`"), "<code>x</code>");
assert_eq!(
md_to_html("`/rename <new title>`"),
"<code>/rename <new title></code>"
);
}
#[test]
fn fenced_code_block_with_language() {
let out = md_to_html("```rust\nlet x = 1;\n```");
assert_eq!(out, "<pre><code>let x = 1;</code></pre>");
assert!(!out.contains("</code>rust"));
}
#[test]
fn fenced_code_block_no_language() {
assert_eq!(
md_to_html("```\nplain\n```"),
"<pre><code>plain</code></pre>"
);
}
#[test]
fn amp_lt_gt_are_escaped_outside_markup() {
assert_eq!(md_to_html("a & b < c > d"), "a & b < c > d");
assert_eq!(
md_to_html("```\nx && y\n```"),
"<pre><code>x && y</code></pre>"
);
}
#[test]
fn unclosed_bold_still_balances() {
assert_eq!(md_to_html("**oops"), "<b>oops</b>");
}