Skip to content

Commit f590535

Browse files
peternewmanDimitriPapadopoulos
authored andcommitted
Recreate Dimitri's demo as a test
1 parent b98f2c6 commit f590535

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

codespell_lib/tests/test_basic.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,25 @@ def test_check_hidden(tmpdir, capsys):
413413
op.join(subdir, '.abandonned', 'abandonned.txt'))
414414
assert cs.main(d) == 0
415415
assert cs.main('--check-hidden', d) == 3
416-
assert cs.main('--check-hidden', '--check-filenames', d) == 7
416+
assert cs.main('--check-hidden', '--check-filenames', d) == 8
417+
os.mkdir(op.join(d, '.abandonned', 'a'))
418+
copyfile(op.join(d, '.abandonned.txt'),
419+
op.join(d, '.abandonned', 'a', 'abandonned.txt'))
420+
assert cs.main(d) == 0
421+
assert cs.main('--check-hidden', d) == 4
422+
assert cs.main('--check-hidden', '--check-filenames', d) == 11
423+
os.mkdir(op.join(d, '.abandonned', 'a', 'b'))
424+
copyfile(op.join(d, '.abandonned.txt'),
425+
op.join(d, '.abandonned', 'a', 'b', 'abandonned.txt'))
426+
assert cs.main(d) == 0
427+
assert cs.main('--check-hidden', d) == 5
428+
assert cs.main('--check-hidden', '--check-filenames', d) == 14
429+
os.mkdir(op.join(d, '.abandonned', 'a', 'b', 'c'))
430+
copyfile(op.join(d, '.abandonned.txt'),
431+
op.join(d, '.abandonned', 'a', 'b', 'c', 'abandonned.txt'))
432+
assert cs.main(d) == 0
433+
assert cs.main('--check-hidden', d) == 6
434+
assert cs.main('--check-hidden', '--check-filenames', d) == 17
417435

418436

419437
def test_case_handling(tmpdir, capsys):

0 commit comments

Comments
 (0)