示例#1
0
    def test_token(self):
        line = "some words in a line"
        token = Token(5, 10, line)

        self.assertEqual(token.value(), "words")
        self.assertEqual(token.fromIndex(), 5)
        self.assertEqual(token.toIndex(), 10)
        self.assertEqual(token.count(), 5)
        self.assertTrue(5 in token)
        self.assertTrue(9 in token)
        self.assertTrue(not 10 in token)
示例#2
0
    def test_token(self):
        line = "some words in a line"
        token = Token(5, 10, line)

        self.assertEqual(token.value(), "words")
        self.assertEqual(token.fromIndex(), 5)
        self.assertEqual(token.toIndex(), 10)
        self.assertEqual(token.count(), 5)
        self.assertTrue(5 in token)
        self.assertTrue(9 in token)
        self.assertTrue(not 10 in token)
示例#3
0
    def test_empty_token(self):
        token = Token(4, 4, "text")

        self.assertEqual(token.value(), "")
示例#4
0
    def test_empty_token(self):
        token = Token(4, 4, "text")

        self.assertEqual(token.value(), "")