-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
# encoding: utf8 | ||
from functools import partial | ||
|
||
from ulauncher.util.text_highlighter import highlight_text | ||
|
||
|
||
def test_highlight_text(): | ||
hl = partial(highlight_text, open_tag='<i>', close_tag='</i>') | ||
assert hl('fifox', 'Firefox') == '<i>Fi</i>re<i>fox</i>' | ||
assert hl(u'fifox', u'Firefox') == '<i>Fi</i>re<i>fox</i>' | ||
assert hl('fifox', 'Firefox') == '<i>Fi</i>re<i>fox</i>' | ||
assert hl('hell wo', 'hello world') == '<i>hell</i>o<i> wo</i>rld' | ||
assert hl('ttesti', 'testik_ls-ttestk') == '<i>testi</i>k_ls-ttestk' | ||
assert hl('dome', 'Documents') == '<i>Do</i>cu<i>me</i>nts' | ||
assert hl('dome', 'Docu & Ments') == '<i>Do</i>cu & <i>Me</i>nts' | ||
assert hl('e tom', u'São tomé & príncipe') == u'São<i> tom</i>é & príncip<i>e</i>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters