From bbb40e30459eca5d4537feb7c47f18931926674e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 21 Aug 2024 16:03:37 -0700 Subject: [PATCH] feat: Add test for --map-mul option and update RepoMap to print map_mul_no_files --- aider/repomap.py | 3 +++ tests/basic/test_main.py | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/aider/repomap.py b/aider/repomap.py index 5f796bc1b..31119f795 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -69,6 +69,9 @@ class RepoMap: self.map_processing_time = 0 self.last_map = None + if self.verbose: + self.io.tool_output(f"RepoMap initialized with map_mul_no_files: {self.map_mul_no_files}") + def token_count(self, text): len_text = len(text) if len_text < 200: diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 0c3c3c131..6f7eff20b 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -574,3 +574,14 @@ class TestMain(TestCase): return_coder=False, ) self.assertIsNone(result) + + def test_map_mul_option(self): + with GitTemporaryDirectory(): + coder = main( + ["--map-mul", "5", "--exit", "--yes"], + input=DummyInput(), + output=DummyOutput(), + return_coder=True, + ) + self.assertIsInstance(coder, Coder) + self.assertEqual(coder.repo_map.map_mul_no_files, 5)