summaryrefslogtreecommitdiff
path: root/src/datastruct
diff options
context:
space:
mode:
authorMitchell Hashimoto <m@mitchellh.com>2025-08-09 13:49:25 -0700
committerMitchell Hashimoto <m@mitchellh.com>2025-08-09 13:49:36 -0700
commitec293c1fd0eeebe7ce72e62c088199937f375877 (patch)
tree44456ae32d9f5e05f0095d699aa3592036d7c485 /src/datastruct
parent8232cf33b4420b9ec8a4d066723ae1a5059e3ccd (diff)
apprt/gtk-ng: active surface hookups
Diffstat (limited to 'src/datastruct')
-rw-r--r--src/datastruct/split_tree.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/datastruct/split_tree.zig b/src/datastruct/split_tree.zig
index a1f2de035..48b887707 100644
--- a/src/datastruct/split_tree.zig
+++ b/src/datastruct/split_tree.zig
@@ -1151,3 +1151,21 @@ test "SplitTree: split twice, remove intermediary" {
t.deinit();
}
}
+
+test "SplitTree: clone empty tree" {
+ const testing = std.testing;
+ const alloc = testing.allocator;
+ var t: TestTree = .empty;
+ defer t.deinit();
+
+ var t2 = try t.clone(alloc);
+ defer t2.deinit();
+
+ {
+ const str = try std.fmt.allocPrint(alloc, "{}", .{t2});
+ defer alloc.free(str);
+ try testing.expectEqualStrings(str,
+ \\empty
+ );
+ }
+}