summaryrefslogtreecommitdiffstats
path: root/vendor/tempfile/tests/namedtempfile.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/tempfile/tests/namedtempfile.rs')
-rw-r--r--vendor/tempfile/tests/namedtempfile.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/tempfile/tests/namedtempfile.rs b/vendor/tempfile/tests/namedtempfile.rs
index 54396c3ac..4b940b6b8 100644
--- a/vendor/tempfile/tests/namedtempfile.rs
+++ b/vendor/tempfile/tests/namedtempfile.rs
@@ -12,6 +12,13 @@ fn exists<P: AsRef<Path>>(path: P) -> bool {
}
#[test]
+fn test_prefix() {
+ let tmpfile = NamedTempFile::with_prefix("prefix").unwrap();
+ let name = tmpfile.path().file_name().unwrap().to_str().unwrap();
+ assert!(name.starts_with("prefix"));
+}
+
+#[test]
fn test_basic() {
let mut tmpfile = NamedTempFile::new().unwrap();
write!(tmpfile, "abcde").unwrap();