@@ -524,6 +524,50 @@ def test_rejects_nonexistent_output_names_with_equivalent_unicode(self):
524524 self .assertFalse (inventory_path .exists ())
525525 self .assertFalse (diagnostics_path .exists ())
526526
527+ def test_rejects_nonexistent_parent_names_differing_only_by_case (self ):
528+ with tempfile .TemporaryDirectory () as directory :
529+ directory = Path (directory )
530+ input_path = directory / "raw.jsonl"
531+ inventory_path = directory / "Reports" / "output.jsonl"
532+ diagnostics_path = directory / "reports" / "output.jsonl"
533+ input_path .write_text ("" , encoding = "utf-8" )
534+
535+ result = self .run_cli (
536+ "--input" ,
537+ input_path ,
538+ "--inventory" ,
539+ inventory_path ,
540+ "--diagnostics" ,
541+ diagnostics_path ,
542+ )
543+
544+ self .assertNotEqual (result .returncode , 0 )
545+ self .assertIn ("distinct files" , result .stderr )
546+ self .assertFalse (inventory_path .parent .exists ())
547+ self .assertFalse (diagnostics_path .parent .exists ())
548+
549+ def test_rejects_nonexistent_parent_names_with_equivalent_unicode (self ):
550+ with tempfile .TemporaryDirectory () as directory :
551+ directory = Path (directory )
552+ input_path = directory / "raw.jsonl"
553+ inventory_path = directory / "caf\u00e9 " / "output.jsonl"
554+ diagnostics_path = directory / "cafe\u0301 " / "output.jsonl"
555+ input_path .write_text ("" , encoding = "utf-8" )
556+
557+ result = self .run_cli (
558+ "--input" ,
559+ input_path ,
560+ "--inventory" ,
561+ inventory_path ,
562+ "--diagnostics" ,
563+ diagnostics_path ,
564+ )
565+
566+ self .assertNotEqual (result .returncode , 0 )
567+ self .assertIn ("distinct files" , result .stderr )
568+ self .assertFalse (inventory_path .parent .exists ())
569+ self .assertFalse (diagnostics_path .parent .exists ())
570+
527571 @unittest .skipUnless (hasattr (os , "symlink" ), "symlinks are unavailable" )
528572 def test_rejects_existing_symlink_path_aliases (self ):
529573 with tempfile .TemporaryDirectory () as directory :
0 commit comments