diff --git a/tests/basic/test_repomap.py b/tests/basic/test_repomap.py index 237565c16..50e00338a 100644 --- a/tests/basic/test_repomap.py +++ b/tests/basic/test_repomap.py @@ -442,14 +442,16 @@ class TestRepoMapAllLanguages(unittest.TestCase): io = InputOutput() repomap_root = Path(__file__).parent.parent.parent repo_map = RepoMap( - main_model=self.GPT35, root=str(sample_code_base), io=io, repomap_root=str(repomap_root) + main_model=self.GPT35, + root=str(repomap_root), + io=io, ) # Get all files in the sample code base other_files = [str(f) for f in sample_code_base.rglob("*") if f.is_file()] # Generate the repo map - generated_map_str = repo_map.get_repo_map([], other_files) + generated_map_str = repo_map.get_repo_map([], other_files).strip() # Read the expected map from the file with open(expected_map_file, "r") as f: diff --git a/tests/fixtures/sample-code-base-repo-map.txt b/tests/fixtures/sample-code-base-repo-map.txt new file mode 100644 index 000000000..29671525f --- /dev/null +++ b/tests/fixtures/sample-code-base-repo-map.txt @@ -0,0 +1,55 @@ + +tests/fixtures/sample-code-base/sample.js: +⋮... +│function greet(name) { +│ return `Hello, ${name}!`; +⋮... +│function calculateCircleArea(radius) { +│ return Math.PI * radius * radius; +⋮... +│function isPrime(number) { +│ if (number <= 1) return false; +│ for (let i = 2; i <= Math.sqrt(number); i++) { +│ if (number % i === 0) return false; +│ } +│ return true; +⋮... +│function reverseString(str) { +│ return str.split('').reverse().join(''); +⋮... +│function getRandomNumber(min, max) { +│ return Math.floor(Math.random() * (max - min + 1)) + min; +⋮... +│function filterEvenNumbers(numbers) { +│ return numbers.filter(num => num % 2 !== 0); +⋮... +│function factorial(n) { +│ if (n === 0 || n === 1) return 1; +│ return n * factorial(n - 1); +⋮... + +tests/fixtures/sample-code-base/sample.py: +│class Car: +│ def __init__(self, make, model, year): +│ self.make = make +│ self.model = model +│ self.year = year +⋮... +│ def accelerate(self, increment): +⋮... +│ def brake(self, decrement): +⋮... +│ def honk(self): +⋮... +│class Garage: +│ def __init__(self): +⋮... +│ def add_car(self, car): +⋮... +│ def remove_car(self, car): +⋮... +│ def list_cars(self): +⋮... +│def main(): +⋮... +