feat(NSPasteboard): added objective c bridge and build changes

This commit is contained in:
Grace Yoder 2026-06-29 09:45:37 -06:00
parent 2f75723e16
commit 308a53f741
4 changed files with 48 additions and 0 deletions

18
src/Clip/NSPasteboard.zig Normal file
View file

@ -0,0 +1,18 @@
const std = @import("std");
extern fn sendPB(text: [*:0]const u8) void;
extern fn initPB() void;
test "objc bridge" {
initPB();
sendPB("test_string");
const result = try std.process.run(std.testing.allocator, std.testing.io, .{
.argv = &.{"pbpaste"},
});
defer std.testing.allocator.free(result.stdout);
defer std.testing.allocator.free(result.stderr);
try std.testing.expectEqualStrings("test_string", std.mem.trim(u8, result.stdout, "\n"));
}