summaryrefslogtreecommitdiff
path: root/src/fence_wrapper.rs
diff options
context:
space:
mode:
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");
+ }
}