diff --git a/codespell_lib/tests/test_basic.py b/codespell_lib/tests/test_basic.py index 8b73584a46..d7162607df 100644 --- a/codespell_lib/tests/test_basic.py +++ b/codespell_lib/tests/test_basic.py @@ -383,6 +383,23 @@ def test_check_hidden(tmpdir, capsys): assert cs.main(d) == 0 assert cs.main('--check-hidden', d) == 2 assert cs.main('--check-hidden', '--check-filenames', d) == 5 + # check again with a relative path + rel = op.relpath(tmpdir) + assert cs.main(rel) == 0 + assert cs.main('--check-hidden', rel) == 2 + assert cs.main('--check-hidden', '--check-filenames', rel) == 5 + # hidden subdirectory + assert cs.main(d) == 0 + assert cs.main('--check-hidden', d) == 2 + assert cs.main('--check-hidden', '--check-filenames', d) == 5 + subdir = op.join(d, 'subdir') + os.mkdir(subdir) + os.mkdir(op.join(subdir, '.abandonned')) + copyfile(op.join(d, '.abandonned.txt'), + op.join(subdir, '.abandonned', 'abandonned.txt')) + assert cs.main(d) == 0 + assert cs.main('--check-hidden', d) == 3 + assert cs.main('--check-hidden', '--check-filenames', d) == 8 def test_case_handling(tmpdir, capsys):