test-fix: 修正测试中的问题

This commit is contained in:
mrbeanc
2023-12-22 23:50:23 +08:00
parent 1e16179e0a
commit ce2251fff6
5 changed files with 21 additions and 15 deletions

View File

@@ -66,6 +66,7 @@ pub fn setup_test_without_mit() {
pub fn ensure_test_file(path: &Path, content: option::Option<&str>) {
// 以测试目录为根目录,创建文件
fs::create_dir_all(path.parent().unwrap()).unwrap(); // ensure父目录
let mut file =
fs::File::create(get_working_dir().unwrap().join(path)).expect(format!("无法创建文件:{:?}", path).as_str());
if let Some(content) = content {