about summary refs log tree commit diff stats
path: root/src/ed.rs
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2020-05-27 00:34:32 -0400
committerBen Morrison <ben@gbmor.dev>2020-05-27 00:34:32 -0400
commit8fbced879b44d65fcf0e59f6ffa3e6c6d4453d6c (patch)
treeabecc2fa87e0aab23d6b9a16f0a9eef98a74834b /src/ed.rs
parent9aaaedcb99227f3ad910057d48568c6b142ced9e (diff)
downloadclinte-8fbced879b44d65fcf0e59f6ffa3e6c6d4453d6c.tar.gz
added test for tempfile creation
Diffstat (limited to 'src/ed.rs')
-rw-r--r--src/ed.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ed.rs b/src/ed.rs
index 5c87133..b87b4a1 100644
--- a/src/ed.rs
+++ b/src/ed.rs
@@ -56,3 +56,16 @@ pub fn call(body: &str) -> String {
     error::helper(fs::remove_file(tmp_loc), "Couldn't remove temporary file");
     body
 }
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn tempfile() {
+        let name = create_tmp_file();
+        assert!(name.is_ok());
+        let name = name.unwrap();
+        fs::remove_file(name).unwrap();
+    }
+}