mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Merge a4ffc85277 into 9082b004b6
This commit is contained in:
commit
4caa21c176
1 changed files with 3 additions and 0 deletions
|
|
@ -642,6 +642,9 @@ pub fn tmpDir(opts: std.fs.Dir.OpenOptions) TmpDir {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// This functions is to be used only in tests. When the two strings are not
|
||||||
|
/// equal, prints diagnostics to stderr to show exactly how they are not equal,
|
||||||
|
/// then returns a `error.TestExpectedEqual`.
|
||||||
pub fn expectEqualStrings(expected: []const u8, actual: []const u8) !void {
|
pub fn expectEqualStrings(expected: []const u8, actual: []const u8) !void {
|
||||||
if (std.mem.indexOfDiff(u8, actual, expected)) |diff_index| {
|
if (std.mem.indexOfDiff(u8, actual, expected)) |diff_index| {
|
||||||
if (@inComptime()) {
|
if (@inComptime()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue