const std = @import("std"); const testing = std.testing; const src = @import("src"); const rsync = src.utils.rsync_embedded.EmbeddedRsync; test "embedded rsync binary creation" { const allocator = testing.allocator; var embedded_rsync = rsync.EmbeddedRsync{ .allocator = allocator }; // Test binary extraction const rsync_path = try embedded_rsync.extractRsyncBinary(); defer allocator.free(rsync_path); // Verify the binary was created const file = try std.fs.cwd().openFile(rsync_path, .{}); defer file.close(); // Verify it's executable const stat = try std.fs.cwd().statFile(rsync_path); try testing.expect(stat.mode & 0o111 != 0); // Verify it's a bash script wrapper const content = try file.readToEndAlloc(allocator, 1024); defer allocator.free(content); try testing.expect(std.mem.indexOf(u8, content, "rsync") != null); try testing.expect(std.mem.indexOf(u8, content, "#!/usr/bin/env bash") != null); }