Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/tools/test_search_hidden_dirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
directories, matching ripgrep's default behavior.
"""

import shutil
import subprocess
import sys

import pytest

Expand Down Expand Up @@ -41,6 +43,7 @@ def searchable_tree(tmp_path):
return tmp_path / "skills"


@pytest.mark.skipif(sys.platform == "win32", reason="find is not available on Windows")
class TestFindExcludesHiddenDirs:
"""_search_files uses find, which should exclude hidden directories."""

Expand Down Expand Up @@ -71,6 +74,7 @@ def test_find_still_returns_visible_files(self, searchable_tree):
assert "SKILL.md" in result.stdout


@pytest.mark.skipif(sys.platform == "win32", reason="grep is not available on Windows")
class TestGrepExcludesHiddenDirs:
"""_search_with_grep should exclude hidden directories."""

Expand All @@ -97,7 +101,7 @@ class TestRipgrepAlreadyExcludesHidden:
"""Verify ripgrep's default behavior is to skip hidden directories."""

@pytest.mark.skipif(
subprocess.run(["which", "rg"], capture_output=True).returncode != 0,
shutil.which("rg") is None,
reason="ripgrep not installed",
)
def test_rg_skips_hub_by_default(self, searchable_tree):
Expand All @@ -110,7 +114,7 @@ def test_rg_skips_hub_by_default(self, searchable_tree):
assert "catalog.json" not in result.stdout

@pytest.mark.skipif(
subprocess.run(["which", "rg"], capture_output=True).returncode != 0,
shutil.which("rg") is None,
reason="ripgrep not installed",
)
def test_rg_finds_visible_content(self, searchable_tree):
Expand Down