use panache::format;
#[test]
fn latex_command_in_paragraph() {
let input = "This is a paragraph with \\textbf{bold text} in the middle.\n";
let output = format(input, None, None);
assert!(output.contains("\\textbf{bold text}"));
similar_asserts::assert_eq!(output, input);
}
#[test]
fn latex_command_with_multiple_args() {
let input = "\\includegraphics[width=0.5\\textwidth]{figure.png}\n";
let output = format(input, None, None);
similar_asserts::assert_eq!(output, input);
}
#[test]
fn latex_command_no_wrap() {
let cfg = panache::ConfigBuilder::default().line_width(30).build();
let input = "This is a very long line with \\pdfpcnote{a very long note that should not be wrapped or reformatted} that exceeds line width.\n";
let output = format(input, Some(cfg), None);
assert!(output.contains("\\pdfpcnote{"));
}
#[test]
fn mixed_latex_and_markdown() {
let input = "Here is some text with \\LaTeX{} and [a link](https://example.com) together.\n";
let output = format(input, None, None);
assert!(output.contains("\\LaTeX{}"));
assert!(output.contains("https://example.com"));
}
#[test]
fn braced_tex_command_block_is_preserved() {
let input = "\\pdfpcnote{\n - blabla\n}\n";
let first = format(input, None, None);
let second = format(&first, None, None);
similar_asserts::assert_eq!(first, second);
similar_asserts::assert_eq!(first, input);
}