Add completion test

This commit is contained in:
fn ⌃ ⌥ 2023-06-24 10:14:58 -07:00
parent a8c81522cd
commit 0baae921ed

View File

@ -509,6 +509,17 @@ test "completion - block" {
, &.{
.{ .label = "blk", .kind = .Text }, // idk what kind this should be
});
try testCompletion(
\\const S = struct { alpha: u32 };
\\const foo: S = undefined;
\\const bar = blk: {
\\ break :blk foo;
\\};
\\const baz = bar.<cursor>
, &.{
.{ .label = "alpha", .kind = .Field, .detail = "alpha: u32" },
});
}
fn testCompletion(source: []const u8, expected_completions: []const Completion) !void {