Codium-ai / cover-agent

CodiumAI Cover-Agent: An AI-Powered Tool for Automated Test Generation and Code Coverage Enhancement! ๐Ÿ’ป๐Ÿค–๐Ÿงช๐Ÿž
https://www.codium.ai/
GNU Affero General Public License v3.0
3.96k stars 262 forks source link

bug: get file base name error in `PromptBuilder` when the operating system is Windows #96

Open betnevs opened 2 weeks ago

betnevs commented 2 weeks ago
class PromptBuilder:

    def __init__(
        self,
        source_file_path: str,
        test_file_path: str,
        code_coverage_report: str,
        included_files: str = "",
        additional_instructions: str = "",
        failed_test_runs: str = "",
        language: str = "python",
    ):
        self.source_file_name = source_file_path.split("/")[-1]
        self.test_file_name = test_file_path.split("/")[-1]
       ......

this code could potentially have issues on a Windows system. In Windows, the path separator is a backslash \, not a forward slash /. Therefore, if run this code on a Windows system, split("/") may not correctly split the file path.