diff options
| author | A Farzat <a@farzat.xyz> | 2026-06-19 04:40:39 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-06-19 04:43:02 +0300 |
| commit | 18a33193000e996e08e9a5547afe62c0346c0e21 (patch) | |
| tree | 9751ca0a24de86fdbcd00a7aaed95449701bef49 /src/fence_wrapper.rs | |
| parent | b1c8df99e5bc3bb6639540ae47c58f1b304715a2 (diff) | |
| download | repo2markdown-18a33193000e996e08e9a5547afe62c0346c0e21.tar.gz repo2markdown-18a33193000e996e08e9a5547afe62c0346c0e21.zip | |
Add the r2md-fence binary
To feed individual files without the extra boilerplate.
Diffstat (limited to 'src/fence_wrapper.rs')
| -rw-r--r-- | src/fence_wrapper.rs | 20 |
1 files changed, 20 insertions, 0 deletions
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"); + } } |
