Skip to content

Commit 69b6c8f

Browse files
committed
improve error message when test fail because of mismatching string
1 parent b49ddf5 commit 69b6c8f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/lsp_features/completion.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4176,10 +4176,10 @@ fn testCompletionWithOptions(
41764176

41774177
if (actual_doc != null and std.mem.eql(u8, expected_doc, actual_doc.?)) break :doc_blk;
41784178

4179-
try error_builder.msgAtIndex("completion item '{s}' should have doc '{s}' but was '{?s}'!", test_uri, cursor_idx, .err, .{
4179+
try error_builder.msgAtIndex("completion item '{s}' should have doc '{'}' but was '{?'}'!", test_uri, cursor_idx, .err, .{
41804180
label,
4181-
expected_doc,
4182-
actual_doc,
4181+
std.zig.fmtEscapes(expected_doc),
4182+
if (actual_doc) |str| std.zig.fmtEscapes(str) else null,
41834183
});
41844184
return error.InvalidCompletionDoc;
41854185
}

tests/lsp_features/hover.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,5 +1053,5 @@ fn testHoverWithOptions(
10531053
const markup_context = response.contents.MarkupContent;
10541054

10551055
try std.testing.expectEqual(options.markup_kind, markup_context.kind);
1056-
try std.testing.expectEqualStrings(expected, markup_context.value);
1056+
try zls.testing.expectEqualStrings(expected, markup_context.value);
10571057
}

0 commit comments

Comments
 (0)