mirror of
https://github.com/codespell-project/codespell.git
synced 2025-05-21 01:17:01 +08:00
Check that we correctly handle nested hidden subdirectories
As mentioned by @DimitriPapadopoulos in https://github.com/codespell-project/codespell/issues/2539#issuecomment-1283830779
This commit is contained in:
@ -400,6 +400,24 @@ def test_check_hidden(tmpdir, capsys):
|
||||
assert cs.main(d) == 0
|
||||
assert cs.main('--check-hidden', d) == 3
|
||||
assert cs.main('--check-hidden', '--check-filenames', d) == 8
|
||||
os.mkdir(op.join(d, '.abandonned', 'a'))
|
||||
copyfile(op.join(d, '.abandonned.txt'),
|
||||
op.join(d, '.abandonned', 'a', 'abandonned.txt'))
|
||||
assert cs.main(d) == 0
|
||||
assert cs.main('--check-hidden', d) == 4
|
||||
assert cs.main('--check-hidden', '--check-filenames', d) == 11
|
||||
os.mkdir(op.join(d, '.abandonned', 'a', 'b'))
|
||||
copyfile(op.join(d, '.abandonned.txt'),
|
||||
op.join(d, '.abandonned', 'a', 'b', 'abandonned.txt'))
|
||||
assert cs.main(d) == 0
|
||||
assert cs.main('--check-hidden', d) == 5
|
||||
assert cs.main('--check-hidden', '--check-filenames', d) == 14
|
||||
os.mkdir(op.join(d, '.abandonned', 'a', 'b', 'c'))
|
||||
copyfile(op.join(d, '.abandonned.txt'),
|
||||
op.join(d, '.abandonned', 'a', 'b', 'c', 'abandonned.txt'))
|
||||
assert cs.main(d) == 0
|
||||
assert cs.main('--check-hidden', d) == 6
|
||||
assert cs.main('--check-hidden', '--check-filenames', d) == 17
|
||||
|
||||
|
||||
def test_case_handling(tmpdir, capsys):
|
||||
|
Reference in New Issue
Block a user