From 4f07c55f033d6794775a44cd7fa02f60ceafe0c4 Mon Sep 17 00:00:00 2001 From: Alex Thiessen Date: Tue, 8 Feb 2022 21:10:40 +0100 Subject: [PATCH] tests/integration: Add a failing test Reproduce https://github.com/wting/autojump/issues/348 --- bin/autojump.py | 1 + tests/integration/autojump_test.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 120000 bin/autojump.py create mode 100644 tests/integration/autojump_test.py diff --git a/bin/autojump.py b/bin/autojump.py new file mode 120000 index 0000000..ee78df4 --- /dev/null +++ b/bin/autojump.py @@ -0,0 +1 @@ +autojump \ No newline at end of file diff --git a/tests/integration/autojump_test.py b/tests/integration/autojump_test.py new file mode 100644 index 0000000..195088c --- /dev/null +++ b/tests/integration/autojump_test.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import os +import sys + +sys.path.append(os.path.join(os.getcwd(), 'bin')) # noqa +from autojump import find_matches +from autojump_data import entriefy + + +def test_find_matches_returns_unique_results(tmpdir): + path = str(tmpdir) + needle = str(os.path.basename(tmpdir)) + + matches = find_matches(entriefy({path: 10}), [needle]) + + assert list(matches) == list(entriefy({path: 10}))