summaryrefslogtreecommitdiff
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2020-09-08 20:33:25 +0200
committerMatthäus G. Chajdas <dev@anteru.net>2020-09-08 20:33:25 +0200
commit203ef1eff6daebab6f95b0b49e6e6a58168073fb (patch)
tree7defa199f48a34787f980b6400d8bbaa9380039a /tests/test_util.py
parente09d4e0cf23d7c6069ddc690942ceb4cd23fd556 (diff)
parentb2c91c70ee536b0472100d1273818f8bb45529fe (diff)
downloadpygments-git-bug/angular-html.tar.gz
Merge branch 'master' into bug/angular-htmlbug/angular-html
# Conflicts: # tests/test_shell.py
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py29
1 files changed, 6 insertions, 23 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 81b3b054..b90397ea 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -127,23 +127,6 @@ def test_xml():
assert not util.looks_like_xml('<html>')
-def test_unirange():
- first_non_bmp = u'\U00010000'
- r = re.compile(util.unirange(0x10000, 0x20000))
- m = r.match(first_non_bmp)
- assert m
- assert m.end() == len(first_non_bmp)
- assert not r.match(u'\uffff')
- assert not r.match(u'xxx')
- # Tests that end is inclusive
- r = re.compile(util.unirange(0x10000, 0x10000) + '+')
- # Tests that the plus works for the entire unicode point, if narrow
- # build
- m = r.match(first_non_bmp * 2)
- assert m
- assert m.end() == len(first_non_bmp) * 2
-
-
def test_format_lines():
lst = ['cat', 'dog']
output = util.format_lines('var', lst)
@@ -173,8 +156,8 @@ def test_duplicates_removed_nonconsecutive():
def test_guess_decode():
# UTF-8 should be decoded as UTF-8
- s = util.guess_decode(u'\xff'.encode('utf-8'))
- assert s == (u'\xff', 'utf-8')
+ s = util.guess_decode('\xff'.encode('utf-8'))
+ assert s == ('\xff', 'utf-8')
# otherwise, it could be latin1 or the locale encoding...
import locale
@@ -186,11 +169,11 @@ def test_guess_decode_from_terminal():
class Term:
encoding = 'utf-7'
- s = util.guess_decode_from_terminal(u'\xff'.encode('utf-7'), Term)
- assert s == (u'\xff', 'utf-7')
+ s = util.guess_decode_from_terminal('\xff'.encode('utf-7'), Term)
+ assert s == ('\xff', 'utf-7')
- s = util.guess_decode_from_terminal(u'\xff'.encode('utf-8'), Term)
- assert s == (u'\xff', 'utf-8')
+ s = util.guess_decode_from_terminal('\xff'.encode('utf-8'), Term)
+ assert s == ('\xff', 'utf-8')
def test_console_ansiformat():