Weird `std.Build.Step.Run.expectStdErr{Exact,Match}` error

This test:

const run = b.addSystemCommand(&.{
    b.graph.zig_exe,
    "fetch",
    "--no-unpack=subpath/../example_dep_file.txt",
});
run.addFileArg(b.path("example/example_dep_file.txt"));
run.expectExitCode(1);
run.expectStdErrMatch("--no-unpack path may not contain '..' components");
test_step.dependOn(&run.step);

Is failing with output:

error: ========= expected to find in stderr: =========
       --no-unpack path may not contain backslashes
       ========= but stderr does not contain it: =====
       error: --no-unpack pack may not contain backslashes

Would appreciate any help in making this test pass :slight_smile:

the difference is path != pack

OMG that’s to embarrassing xD

I tried to reduce the string I was matching for and went

“error: --no-unpack path may not contain backslashes\n”

“–no-unpack path may not contain backslashes”

“path”

MFW when they all failed…

1 Like