summaryrefslogtreecommitdiff
path: root/tests/test_kotlin.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2019-05-06 16:18:56 +0200
committerGeorg Brandl <georg@python.org>2019-11-10 10:15:13 +0100
commita281ff8367a3a5f4cc17c9956e9273593558d336 (patch)
treeee145581327104377a6d079d2c3ec5c1e188bf7d /tests/test_kotlin.py
parenta41f232a0aa9f2b435e54a7e247c858a8f2d7fa8 (diff)
downloadpygments-git-a281ff8367a3a5f4cc17c9956e9273593558d336.tar.gz
Cleanup test modules, more pytest-like testing.
Diffstat (limited to 'tests/test_kotlin.py')
-rw-r--r--tests/test_kotlin.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_kotlin.py b/tests/test_kotlin.py
index 417d0d9f..b56e5e5c 100644
--- a/tests/test_kotlin.py
+++ b/tests/test_kotlin.py
@@ -9,15 +9,16 @@
import unittest
-from pygments.token import Text, Name, Operator, Keyword, Number, Punctuation, String
+from pygments.token import Text, Name, Keyword, Punctuation, String
from pygments.lexers import KotlinLexer
+
class KotlinTest(unittest.TestCase):
def setUp(self):
self.lexer = KotlinLexer()
self.maxDiff = None
-
+
def testCanCopeWithBackTickNamesInFunctions(self):
fragment = u'fun `wo bble`'
tokens = [
@@ -37,7 +38,7 @@ class KotlinTest(unittest.TestCase):
(Text, u'\n')
]
self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
+
def testCanCopeWithDestructuring(self):
fragment = u'val (a, b) = '
tokens = [
@@ -55,7 +56,7 @@ class KotlinTest(unittest.TestCase):
(Text, u'\n')
]
self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
+
def testCanCopeGenericsInDestructuring(self):
fragment = u'val (a: List<Something>, b: Set<Wobble>) ='
tokens = [
@@ -122,7 +123,7 @@ class KotlinTest(unittest.TestCase):
def testShouldCopeWithMultilineComments(self):
fragment = u'"""\nthis\nis\na\ncomment"""'
tokens = [
- (String, u'"""\nthis\nis\na\ncomment"""'),
+ (String, u'"""\nthis\nis\na\ncomment"""'),
(Text, u'\n')
]
self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))