Skip to content
Merged
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
19 changes: 19 additions & 0 deletions tests/test_compact_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ def test_normalize_compact_source_resolves_existing_relative_path(tmp_path: Path
assert normalized == str(note.resolve())


def test_normalize_compact_source_expands_user_home(monkeypatch, tmp_path: Path):
home = tmp_path / "home"
note = home / "memory" / "old-notes.md"
note.parent.mkdir(parents=True)
note.write_text("# note\n")

monkeypatch.setenv("HOME", str(home))

normalized = cli_module._normalize_compact_source("~/memory/old-notes.md")

assert normalized == str(note.resolve())


def test_normalize_compact_source_leaves_non_path_filters_unchanged() -> None:
source = "session:abc123"

assert cli_module._normalize_compact_source(source) == source


def test_compact_shows_matched_source_when_no_chunks(monkeypatch, tmp_path: Path):
note = tmp_path / "memory" / "old-notes.md"
note.parent.mkdir()
Expand Down
Loading