summaryrefslogtreecommitdiff
path: root/src/fence_wrapper.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-06-19 04:40:39 +0300
committerA Farzat <a@farzat.xyz>2026-06-19 04:43:02 +0300
commit18a33193000e996e08e9a5547afe62c0346c0e21 (patch)
tree9751ca0a24de86fdbcd00a7aaed95449701bef49 /src/fence_wrapper.rs
parentb1c8df99e5bc3bb6639540ae47c58f1b304715a2 (diff)
downloadrepo2markdown-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.rs20
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");
+ }
}