feat: add sts.testing for comparison, test getDescription

pull/9551/head
Denys Zhak 2025-11-18 01:29:59 +01:00
parent c5ada505af
commit e0007a66e7
1 changed files with 4 additions and 4 deletions

View File

@ -194,13 +194,13 @@ fn getDescription(comptime help: []const u8) []const u8 {
} }
test "getDescription" { test "getDescription" {
const testing = std.testing;
const input = "First sentence with \"quotes\"\nand newlines. Second sentence."; const input = "First sentence with \"quotes\"\nand newlines. Second sentence.";
const expected = "First sentence with \\\"quotes\\\" and newlines."; const expected = "First sentence with \\\"quotes\\\" and newlines.";
const result = comptime getDescription(input);
comptime { comptime {
if (!std.mem.eql(u8, result, expected)) { const result = getDescription(input);
@compileError("getDescription test failed: expected '" ++ expected ++ "' but got '" ++ result ++ "'"); try testing.expectEqualStrings(expected, result);
}
} }
} }