Several fixes for File.extract

Tweaks and fixes.
This commit is contained in:
Caleb Gardner
2025-05-25 05:34:32 -05:00
parent 82011a092c
commit dd452060cb
7 changed files with 101 additions and 71 deletions
+9 -2
View File
@@ -80,8 +80,6 @@ pub const Reader = struct {
test "root iter" {
const test_sfs_path = "testing/LinuxPATest.sfs";
// const test_file_path = "PortableApps/PortableApps.com/Data/PortableAppsMenu.ini";
var rdr: Reader = try .init(std.testing.allocator, test_sfs_path, 0);
defer rdr.deinit();
var rootIter = try rdr.root.iterator(&rdr);
@@ -90,3 +88,12 @@ test "root iter" {
std.debug.print("{s}\n", .{f.name});
}
}
test "extract" {
const test_sfs_path = "testing/LinuxPATest.sfs";
const extract_path = "testing/testExtract";
try std.fs.cwd().deleteTree(extract_path);
var rdr: Reader = try .init(std.testing.allocator, test_sfs_path, 0);
defer rdr.deinit();
try rdr.root.extract(&rdr, extract_path);
}