diff --git a/.gitignore b/.gitignore index aa70e86..f1713db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -tags -bin/autojump.py +.coverage *.pyc *~ *.tar.gz *.patch +tags diff --git a/Makefile b/Makefile index cf832e1..5eb2329 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = $(shell grep -oE "[0-9]+\.[0-9]+\.[0-9]+" bin/autojump) TAGNAME = release-v$(VERSION) -.PHONY: docs install uninstall lint tar +.PHONY: docs install uninstall lint tar test install: install.sh diff --git a/tests/autojump_utils_test.py b/tests/autojump_utils_test.py index ebc419e..deadba1 100644 --- a/tests/autojump_utils_test.py +++ b/tests/autojump_utils_test.py @@ -22,6 +22,7 @@ from autojump_utils import create_dir from autojump_utils import decode from autojump_utils import first from autojump_utils import get_pwd +from autojump_utils import get_tab_entry_info from autojump_utils import has_uppercase from autojump_utils import in_bash from autojump_utils import last @@ -157,5 +158,18 @@ class FileSystemIntegrationTests(TestCase): assert_true(os.path.exists(dst)) +def HelperFunctionsUnitTests(TestCase): + def test_get_needle(self): + assert_equal(('foo', None, None), get_tab_entry_info('foo__', '__')) + + def test_get_index(self): + assert_equal(('foo', 2, None), get_tab_entry_info('foo__2', '__')) + + def test_get_path(self): + assert_equal( + ('foo', 3, '/foo'), + get_tab_entry_info('foo__3__/foo', '__')) + + if __name__ == "__main__": run()