diff --git a/tests/basic/test_repomap.py b/tests/basic/test_repomap.py index a6e44e831..e5b0f76f8 100644 --- a/tests/basic/test_repomap.py +++ b/tests/basic/test_repomap.py @@ -385,92 +385,117 @@ class Greeter { } } """, - "Greeter" # Key symbol to check + "Greeter", # Key symbol to check ), "c": ( "test.c", - '#include \n\nint main() {\n printf("Hello, World!\\n");\n return 0;\n}\n', - "main" # Key symbol to check + ( + '#include \n\nint main() {\n printf("Hello, World!\\n");\n ' + " return 0;\n}\n" + ), + "main", # Key symbol to check ), "csharp": ( "test.cs", - 'using System;\n\nclass Program {\n static void Main() {\n Console.WriteLine("Hello, World!");\n }\n}\n', - "Program" # Key symbol to check + ( + "using System;\n\nclass Program {\n static void Main() {\n " + ' Console.WriteLine("Hello, World!");\n }\n}\n' + ), + "Program", # Key symbol to check ), "cpp": ( "test.cpp", - '#include \n\nint main() {\n std::cout << "Hello, World!" << std::endl;\n return 0;\n}\n', - "main" # Key symbol to check + ( + '#include \n\nint main() {\n std::cout << "Hello, World!" <<' + " std::endl;\n return 0;\n}\n" + ), + "main", # Key symbol to check ), "elisp": ( "test.el", '(defun greet (name)\n (message "Hello, %s!" name))\n', - "greet" # Key symbol to check + "greet", # Key symbol to check ), "elixir": ( "test.ex", - 'defmodule Greeter do\n def hello(name) do\n IO.puts("Hello, #{name}!")\n end\nend\n', - "Greeter" # Key symbol to check + ( + 'defmodule Greeter do\n def hello(name) do\n IO.puts("Hello, #{name}!")\n ' + " end\nend\n" + ), + "Greeter", # Key symbol to check ), "elm": ( "test.elm", - 'module Main exposing (main)\n\nimport Html exposing (text)\n\nmain =\n text "Hello, World!"\n', - "Main" # Key symbol to check + ( + "module Main exposing (main)\n\nimport Html exposing (text)\n\nmain =\n text" + ' "Hello, World!"\n' + ), + "Main", # Key symbol to check ), "go": ( "test.go", - 'package main\n\nimport "fmt"\n\nfunc main() {\n fmt.Println("Hello, World!")\n}\n', - "main" # Key symbol to check + ( + 'package main\n\nimport "fmt"\n\nfunc main() {\n fmt.Println("Hello,' + ' World!")\n}\n' + ), + "main", # Key symbol to check ), "java": ( "Test.java", - 'public class Test {\n public static void main(String[] args) {\n System.out.println("Hello, World!");\n }\n}\n', - "Test" # Key symbol to check + ( + "public class Test {\n public static void main(String[] args) {\n " + ' System.out.println("Hello, World!");\n }\n}\n' + ), + "Test", # Key symbol to check ), "javascript": ( "test.js", "function greet(name) {\n console.log(`Hello, ${name}!`);\n}\n", - "greet" # Key symbol to check + "greet", # Key symbol to check ), "ocaml": ( "test.ml", 'let greet name =\n Printf.printf "Hello, %s!\\n" name\n', - "greet" # Key symbol to check + "greet", # Key symbol to check ), "php": ( "test.php", '\n', - "greet" # Key symbol to check + "greet", # Key symbol to check ), "python": ( "test.py", 'def greet(name):\n print(f"Hello, {name}!")\n', - "greet" # Key symbol to check + "greet", # Key symbol to check ), "ql": ( "test.ql", 'predicate greet(string name) {\n name = "World"\n}\n', - "greet" # Key symbol to check + "greet", # Key symbol to check ), "ruby": ( "test.rb", 'def greet(name)\n puts "Hello, #{name}!"\nend\n', - "greet" # Key symbol to check + "greet", # Key symbol to check ), "rust": ( "test.rs", 'fn main() {\n println!("Hello, World!");\n}\n', - "main" # Key symbol to check + "main", # Key symbol to check ), "typescript": ( "test.ts", "function greet(name: string): void {\n console.log(`Hello, ${name}!`);\n}\n", - "greet" # Key symbol to check + "greet", # Key symbol to check ), "tsx": ( "test.tsx", - "import React from 'react';\n\nconst Greeting: React.FC<{ name: string }> = ({ name }) => {\n return

Hello, {name}!

;\n};\n\nexport default Greeting;\n", - "Greeting" # Key symbol to check + ( + "import React from 'react';\n\nconst Greeting: React.FC<{ name: string }> = ({" + " name }) => {\n return

Hello, {name}!

;\n};\n\nexport default" + " Greeting;\n" + ), + "Greeting", # Key symbol to check ), } @@ -481,13 +506,19 @@ class Greeter { io = InputOutput() repo_map = RepoMap(main_model=self.GPT35, root=temp_dir, io=io) - other_files = [os.path.join(temp_dir, filename) for filename, _, _ in language_files.values()] + other_files = [ + os.path.join(temp_dir, filename) for filename, _, _ in language_files.values() + ] result = repo_map.get_repo_map([], other_files) # Check if the result contains all the expected files and symbols for lang, (filename, _, key_symbol) in language_files.items(): self.assertIn(filename, result, f"File for language {lang} not found in repo map") - self.assertIn(key_symbol, result, f"Key symbol '{key_symbol}' for language {lang} not found in repo map") + self.assertIn( + key_symbol, + result, + f"Key symbol '{key_symbol}' for language {lang} not found in repo map", + ) # close the open cache files, so Windows won't error del repo_map