[kupfer] relevance: Add one doctest to _findBestMatch
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] relevance: Add one doctest to _findBestMatch
- Date: Fri, 11 Sep 2009 18:50:05 +0000 (UTC)
commit fe859356ee89dba8ae969681d1770c289acafa17
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Fri Sep 11 19:06:27 2009 +0200
relevance: Add one doctest to _findBestMatch
kupfer/relevance.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/relevance.py b/kupfer/relevance.py
index 698951e..8eb3b88 100644
--- a/kupfer/relevance.py
+++ b/kupfer/relevance.py
@@ -178,8 +178,11 @@ def _findBestMatch(s, query):
Returns: a two-item tuple containing the start and end indicies of
the match. No match returns (-1,-1).
+
>>> _findBestMatch('terminal', 'yl')
(-1, -1)
+ >>> _findBestMatch('terminal', 'term')
+ (0, 4)
>>> _findBestMatch('terminal', 'trml')
(0, 8)
>>> _findBestMatch('teerminal', 'erml')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]