diff --git a/tools/get_maintainer.py b/tools/get_maintainer.py index 6481e24a..96e624b8 100644 --- a/tools/get_maintainer.py +++ b/tools/get_maintainer.py @@ -70,6 +70,7 @@ matched_maintainers = set() for file in files_to_check: + file = file.replace("\\", "/") for section in sections: for path in section["files"]: # Direct folder matching (Wave-style directory structure) diff --git a/tools/test_get_maintainer.py b/tools/test_get_maintainer.py index e5a4b03b..e4f2547e 100644 --- a/tools/test_get_maintainer.py +++ b/tools/test_get_maintainer.py @@ -24,6 +24,27 @@ def test_invocation_outside_repository_root(self): self.assertIn("Maintainers to CC:", result.stdout) self.assertNotIn("MAINTAINERS file not found", result.stdout) + def run_script(self, path): + return subprocess.run( + [sys.executable, str(SCRIPT), path], + cwd=ROOT, + capture_output=True, + text=True, + check=False, + ) + + def test_windows_and_repository_paths_match_same_section(self): + unix = self.run_script("front/parser/file.rs") + windows = self.run_script(r"front\parser\file.rs") + + self.assertEqual(unix.returncode, 0, unix.stderr) + self.assertEqual(windows.returncode, 0, windows.stderr) + self.assertEqual(windows.stdout, unix.stdout) + self.assertIn("Maintainers to CC:", windows.stdout) + + sibling = self.run_script(r"front\parser-other\file.rs") + self.assertIn("Using default", sibling.stdout) + if __name__ == "__main__": unittest.main()