Skip to content

Commit

Permalink
add helper functions unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wting committed Jan 1, 2014
1 parent 80d7ab6 commit b3162c9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
tags .coverage
bin/autojump.py
*.pyc *.pyc
*~ *~
*.tar.gz *.tar.gz
*.patch *.patch
tags
2 changes: 1 addition & 1 deletion Makefile
Original file line number Original file line Diff line number Diff line change
@@ -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
Expand Down
14 changes: 14 additions & 0 deletions tests/autojump_utils_test.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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
Expand Down Expand Up @@ -157,5 +158,18 @@ def test_move_file(self):
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()

0 comments on commit b3162c9

Please sign in to comment.