aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/lib/compat/testing.zig
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-10 21:51:57 +0300
committerGitHub <noreply@github.com>2026-09-10 21:51:57 +0300
commit425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch)
treee52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/lib/compat/testing.zig
parent90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff)
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/lib/compat/testing.zig')
-rw-r--r--vendor/libghostty-vt/src/lib/compat/testing.zig19
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/lib/compat/testing.zig b/vendor/libghostty-vt/src/lib/compat/testing.zig
new file mode 100644
index 00000000..e826eb40
--- /dev/null
+++ b/vendor/libghostty-vt/src/lib/compat/testing.zig
@@ -0,0 +1,19 @@
+//! Code taken from 0.15.2 `std.testing`. See README.md for license and
+//! details.
+const builtin = @import("builtin");
+const std = @import("std");
+
+/// Given a type, recursively references all the declarations inside, so that the semantic analyzer sees them.
+/// For deep types, you may use `@setEvalBranchQuota`.
+pub fn refAllDeclsRecursive(comptime T: type) void {
+ if (!builtin.is_test) return;
+ inline for (comptime std.meta.declarations(T)) |decl| {
+ if (@TypeOf(@field(T, decl.name)) == type) {
+ switch (@typeInfo(@field(T, decl.name))) {
+ .@"struct", .@"enum", .@"union", .@"opaque" => refAllDeclsRecursive(@field(T, decl.name)),
+ else => {},
+ }
+ }
+ _ = &@field(T, decl.name);
+ }
+}