Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Quentin 2026-05-25 16:05:26 +02:00 committed by GitHub
parent f71bfd3b8c
commit adb1ca74ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
202 changed files with 5828 additions and 1968 deletions

View file

@ -198,6 +198,21 @@ async def test_uses_effective_workdir(tmp_path, monkeypatch):
assert "test.py" in result.matches
@pytest.mark.asyncio
async def test_single_file_match_includes_filename_in_output(grep, tmp_path):
# Without --with-filename / -H, rg and grep omit the filename when
# searching a single file, causing GrepMatch.from_output_line to
# misinterpret the line number as a path. See VIBE-2772.
(tmp_path / "only.py").write_text("hit one\nnope\nhit two\n")
result = await collect_result(grep.run(GrepArgs(pattern="hit", path="only.py")))
assert result.match_count == 2
for parsed in result.parsed_matches:
assert parsed.path.endswith("only.py")
assert parsed.line is not None
@pytest.mark.skipif(not shutil.which("grep"), reason="GNU grep not available")
class TestGnuGrepBackend:
@pytest.mark.asyncio