| 183 | |
| 184 | async def test_grep_supports_head_limit_and_offset(self) -> None: |
| 185 | root = Path.cwd() / ".tmp-test" / f"native-tool-stack-{uuid.uuid4().hex}" |
| 186 | root.mkdir(parents=True, exist_ok=True) |
| 187 | try: |
| 188 | (root / "src").mkdir() |
| 189 | for idx in range(4): |
| 190 | (root / "src" / f"f{idx}.txt").write_text(f"VALUE {idx}\n", encoding="utf-8") |
| 191 | |
| 192 | first = await grep("VALUE", path=str(root / "src"), file_glob="*.txt", head_limit=1) |
| 193 | second = await grep("VALUE", path=str(root / "src"), file_glob="*.txt", head_limit=1, offset=1) |
| 194 | finally: |
| 195 | import shutil |