| ... | @@ -677,6 +677,22 @@ test "makePath, put some files in it, deleteTree" { | ... | @@ -677,6 +677,22 @@ test "makePath, put some files in it, deleteTree" { |
| 677 | } | 677 | } |
| 678 | } | 678 | } |
| 679 | | 679 | |
| | 680 | test "makePath, put some files in it, deleteTreeMinStackSize" { |
| | 681 | var tmp = tmpDir(.{}); |
| | 682 | defer tmp.cleanup(); |
| | 683 | |
| | 684 | try tmp.dir.makePath("os_test_tmp" ++ fs.path.sep_str ++ "b" ++ fs.path.sep_str ++ "c"); |
| | 685 | try tmp.dir.writeFile("os_test_tmp" ++ fs.path.sep_str ++ "b" ++ fs.path.sep_str ++ "c" ++ fs.path.sep_str ++ "file.txt", "nonsense"); |
| | 686 | try tmp.dir.writeFile("os_test_tmp" ++ fs.path.sep_str ++ "b" ++ fs.path.sep_str ++ "file2.txt", "blah"); |
| | 687 | try tmp.dir.deleteTreeMinStackSize("os_test_tmp"); |
| | 688 | if (tmp.dir.openDir("os_test_tmp", .{})) |dir| { |
| | 689 | _ = dir; |
| | 690 | @panic("expected error"); |
| | 691 | } else |err| { |
| | 692 | try testing.expect(err == error.FileNotFound); |
| | 693 | } |
| | 694 | } |
| | 695 | |
| 680 | test "makePath in a directory that no longer exists" { | 696 | test "makePath in a directory that no longer exists" { |
| 681 | if (builtin.os.tag == .windows) return error.SkipZigTest; // Windows returns FileBusy if attempting to remove an open dir | 697 | if (builtin.os.tag == .windows) return error.SkipZigTest; // Windows returns FileBusy if attempting to remove an open dir |
| 682 | | 698 | |