Skip to content

Commit bb12dab

Browse files
committed
feat: introduce testing namespace
This will be used for unit tests in Capy. As of now, it's loosely inspired by dvui's testing capabilities
1 parent 3890d90 commit bb12dab

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/testing.zig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! Testing module for Capy applications
2+
const capy = @import("capy.zig");
3+
4+
pub const VirtualWindow = struct {
5+
window: capy.Window,
6+
7+
pub fn init() !VirtualWindow {
8+
const window = try capy.Window.init();
9+
return VirtualWindow{ .window = window };
10+
}
11+
12+
pub fn deinit(self: *VirtualWindow) void {
13+
self.window.deinit();
14+
}
15+
16+
// TODO: methods: expectFocused, expectNotFocused, pressKey, click, expectVisible,
17+
// expectNotVisible, hash (to check if two states are identical or not) ...
18+
};

0 commit comments

Comments
 (0)