1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

add helper functions unit tests

This commit is contained in:
William Ting 2013-12-31 18:39:45 -06:00
parent 80d7ab660f
commit b3162c917b
3 changed files with 17 additions and 3 deletions

4
.gitignore vendored
View File

@ -1,6 +1,6 @@
tags .coverage
bin/autojump.py
*.pyc *.pyc
*~ *~
*.tar.gz *.tar.gz
*.patch *.patch
tags

View File

@ -1,7 +1,7 @@
VERSION = $(shell grep -oE "[0-9]+\.[0-9]+\.[0-9]+" bin/autojump) VERSION = $(shell grep -oE "[0-9]+\.[0-9]+\.[0-9]+" bin/autojump)
TAGNAME = release-v$(VERSION) TAGNAME = release-v$(VERSION)
.PHONY: docs install uninstall lint tar .PHONY: docs install uninstall lint tar test
install: install:
install.sh install.sh

View File

@ -22,6 +22,7 @@ from autojump_utils import create_dir
from autojump_utils import decode from autojump_utils import decode
from autojump_utils import first from autojump_utils import first
from autojump_utils import get_pwd from autojump_utils import get_pwd
from autojump_utils import get_tab_entry_info
from autojump_utils import has_uppercase from autojump_utils import has_uppercase
from autojump_utils import in_bash from autojump_utils import in_bash
from autojump_utils import last from autojump_utils import last
@ -157,5 +158,18 @@ class FileSystemIntegrationTests(TestCase):
assert_true(os.path.exists(dst)) 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__": if __name__ == "__main__":
run() run()