From 425c86179791cd32e2d4ce0ae7f269940b4b0663 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Thu, 10 Sep 2026 21:51:57 +0300 Subject: chore: upgrade libghostty and preserve terminal behavior (#3906) --- vendor/libghostty-vt/src/lib/compat/testing.zig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 vendor/libghostty-vt/src/lib/compat/testing.zig (limited to 'vendor/libghostty-vt/src/lib/compat/testing.zig') 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); + } +} -- cgit v1.2.3