From 18a33193000e996e08e9a5547afe62c0346c0e21 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Fri, 19 Jun 2026 04:40:39 +0300 Subject: Add the r2md-fence binary To feed individual files without the extra boilerplate. --- src/fence_wrapper.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/fence_wrapper.rs') diff --git a/src/fence_wrapper.rs b/src/fence_wrapper.rs index a218088..fc8f1c2 100644 --- a/src/fence_wrapper.rs +++ b/src/fence_wrapper.rs @@ -66,4 +66,24 @@ mod tests { assert_eq!(String::from_utf8(output).unwrap(), "```text\n\n```\n"); } + + #[test] + fn supports_empty_language() { + let input = Cursor::new("hello\n"); + let mut output = Vec::new(); + + wrap_in_fence(input, &mut output, "").unwrap(); + + assert_eq!(String::from_utf8(output).unwrap(), "```\nhello\n\n```\n"); + } + + #[test] + fn wraps_empty_input_with_empty_language() { + let input = Cursor::new(""); + let mut output = Vec::new(); + + wrap_in_fence(input, &mut output, "").unwrap(); + + assert_eq!(String::from_utf8(output).unwrap(), "```\n\n```\n"); + } } -- cgit v1.3.1