Lines Matching refs:tmpfile
15 let mut tmpfile = NamedTempFile::new().unwrap(); in test_basic() localVariable
16 write!(tmpfile, "abcde").unwrap(); in test_basic()
17 tmpfile.seek(SeekFrom::Start(0)).unwrap(); in test_basic()
19 tmpfile.read_to_string(&mut buf).unwrap(); in test_basic()
25 let tmpfile = NamedTempFile::new().unwrap(); in test_deleted() localVariable
26 let path = tmpfile.path().to_path_buf(); in test_deleted()
28 drop(tmpfile); in test_deleted()
34 let mut tmpfile = NamedTempFile::new().unwrap(); in test_persist() localVariable
35 let old_path = tmpfile.path().to_path_buf(); in test_persist()
37 write!(tmpfile, "abcde").unwrap(); in test_persist()
40 let mut f = tmpfile.persist(&persist_path).unwrap(); in test_persist()
63 let mut tmpfile = NamedTempFile::new().unwrap(); in test_persist_noclobber() localVariable
64 let old_path = tmpfile.path().to_path_buf(); in test_persist_noclobber()
67 write!(tmpfile, "abcde").unwrap(); in test_persist_noclobber()
70 tmpfile = tmpfile.persist_noclobber(&persist_path).unwrap_err().into(); in test_persist_noclobber()
75 tmpfile.persist_noclobber(&persist_path).unwrap(); in test_persist_noclobber()
87 let tmpfile = Builder::new() in test_customnamed() localVariable
93 let name = tmpfile.path().file_name().unwrap().to_str().unwrap(); in test_customnamed()
101 let mut tmpfile = Builder::new().append(true).tempfile().unwrap(); in test_append() localVariable
102 tmpfile.write(b"a").unwrap(); in test_append()
103 tmpfile.seek(SeekFrom::Start(0)).unwrap(); in test_append()
104 tmpfile.write(b"b").unwrap(); in test_append()
106 tmpfile.seek(SeekFrom::Start(0)).unwrap(); in test_append()
108 tmpfile.read_exact(&mut buf).unwrap(); in test_append()
143 let tmpfile = NamedTempFile::new().unwrap(); in test_immut() localVariable
144 (&tmpfile).write_all(b"abcde").unwrap(); in test_immut()
145 (&tmpfile).seek(SeekFrom::Start(0)).unwrap(); in test_immut()
147 (&tmpfile).read_to_string(&mut buf).unwrap(); in test_immut()
153 let mut tmpfile = NamedTempFile::new().unwrap(); in test_temppath() localVariable
154 write!(tmpfile, "abcde").unwrap(); in test_temppath()
156 let path = tmpfile.into_temp_path(); in test_temppath()
162 let mut tmpfile = NamedTempFile::new().unwrap(); in test_temppath_persist() localVariable
163 write!(tmpfile, "abcde").unwrap(); in test_temppath_persist()
165 let tmppath = tmpfile.into_temp_path(); in test_temppath_persist()
190 let mut tmpfile = NamedTempFile::new().unwrap(); in test_temppath_persist_noclobber() localVariable
191 write!(tmpfile, "abcde").unwrap(); in test_temppath_persist_noclobber()
193 let mut tmppath = tmpfile.into_temp_path(); in test_temppath_persist_noclobber()
228 let tmpfile = NamedTempFile::new_in(".").unwrap(); in test_change_dir() localVariable
229 let path = env::current_dir().unwrap().join(tmpfile.path()); in test_change_dir()
231 drop(tmpfile); in test_change_dir()
258 let mut tmpfile = NamedTempFile::new().unwrap(); in test_keep() localVariable
259 write!(tmpfile, "abcde").unwrap(); in test_keep()
260 let (mut f, temp_path) = tmpfile.into_parts(); in test_keep()