@@ -99,7 +99,7 @@ def test_exclude_flag(tmp_path: Path):
9999 str (source_dir ),
100100 str (output_file ),
101101 "--exclude" ,
102- r "exclude\ .custom$ " ,
102+ "exclude.custom" ,
103103 ]
104104 with patch .object (sys , "argv" , test_args ):
105105 main ()
@@ -135,7 +135,7 @@ def test_whitelist_flag(tmp_path: Path):
135135 str (source_dir ),
136136 str (output_file ),
137137 "--whitelist" ,
138- r"\ .py$ " ,
138+ "* .py" ,
139139 ]
140140 with patch .object (sys , "argv" , test_args ):
141141 main ()
@@ -165,8 +165,6 @@ def test_no_gitignore_flag(tmp_path: Path):
165165 str (source_dir ),
166166 str (output_file ),
167167 "--no-gitignore" ,
168- "--exclude" ,
169- "" ,
170168 ]
171169 with patch .object (sys , "argv" , test_args ):
172170 main ()
@@ -187,7 +185,7 @@ def test_gitignore_default(tmp_path: Path):
187185 # Simulate command line: codeconcat ./src output.txt --exclude ''
188186 # ADDED --exclude '' to disable default config excludes for this test
189187 # This isolates the effect of ONLY the .gitignore file
190- test_args = ["codeconcat" , str (source_dir ), str (output_file ), "--exclude" , "" ]
188+ test_args = ["codeconcat" , str (source_dir ), str (output_file )]
191189 with patch .object (sys , "argv" , test_args ):
192190 main ()
193191
@@ -317,3 +315,22 @@ def test_exclude_output_file_implicitly(tmp_path: Path):
317315 assert "print('hello')" in content
318316 assert "PRE_EXISTING_OUTPUT_CONTENT" not in content
319317 assert f"### File: `{ output_file .name } `" not in content
318+
319+
320+ def test_glob_exclusion_translation (tmp_path : Path ):
321+ """Test that glob patterns (e.g. *.lock) are correctly translated and do not crash."""
322+ source_dir = tmp_path / "src"
323+ output_file = tmp_path / "output.txt"
324+ create_test_files (
325+ source_dir , {"keep.py" : "keep" , "ignore.lock" : "ignore" , "nested/ignore.lock" : "ignore" }
326+ )
327+
328+ # Simulate --exclude "*.lock"
329+ test_args = ["codeconcat" , str (source_dir ), str (output_file ), "--exclude" , "*.lock" ]
330+ with patch .object (sys , "argv" , test_args ):
331+ main ()
332+
333+ assert output_file .exists ()
334+ content = output_file .read_text ()
335+ assert "keep.py" in content
336+ assert "ignore.lock" not in content
0 commit comments