diff --git a/src/extra/fish.zig b/src/extra/fish.zig index 2f00bca59..1419fde5f 100644 --- a/src/extra/fish.zig +++ b/src/extra/fish.zig @@ -192,3 +192,15 @@ fn getDescription(comptime help: []const u8) []const u8 { return out[0..len]; } + +test "getDescription" { + const input = "First sentence with \"quotes\"\nand newlines. Second sentence."; + const expected = "First sentence with \\\"quotes\\\" and newlines."; + const result = comptime getDescription(input); + + comptime { + if (!std.mem.eql(u8, result, expected)) { + @compileError("getDescription test failed: expected '" ++ expected ++ "' but got '" ++ result ++ "'"); + } + } +}