示例#1
0
 def test_empty_string(self):
     self.assertEqual(
         next(visp.lex('""')).type,
         'string')
     self.assertEqual(
         next(visp.lex('""')).string,
         '')
示例#2
0
 def test_lparen(self):
     self.assertEqual(
         next(visp.lex('(')).type,
         'lparen')
示例#3
0
 def test_quote(self):
     self.assertEqual(
         next(visp.lex('\'')).type,
         'quote')
示例#4
0
 def test_hashsym3(self):
     self.assertEqual(
         next(visp.lex('#hello')).type,
         'hashsym')
示例#5
0
 def test_hashsym1(self):
     self.assertEqual(
         next(visp.lex('#e')).type,
         'hashsym')
示例#6
0
 def test_symbol(self):
     self.assertEqual(
         next(visp.lex('foo%$!')).type,
         'symbol')
示例#7
0
 def test_number(self):
     self.assertEqual(
         next(visp.lex('12345')).type,
         'number')
示例#8
0
 def test_number(self):
     self.assertEqual(next(visp.lex('12345')).type, 'number')
示例#9
0
 def test_wspace(self):
     self.assertEqual(len(list(visp.lex('     '))), 0)
示例#10
0
 def test_lparen(self):
     self.assertEqual(next(visp.lex('(')).type, 'lparen')
示例#11
0
 def test_empty_string(self):
     self.assertEqual(next(visp.lex('""')).type, 'string')
     self.assertEqual(next(visp.lex('""')).string, '')
示例#12
0
 def test_quote(self):
     self.assertEqual(next(visp.lex('\'')).type, 'quote')
示例#13
0
 def test_hashsym3(self):
     self.assertEqual(next(visp.lex('#hello')).type, 'hashsym')
示例#14
0
 def test_hashsym1(self):
     self.assertEqual(next(visp.lex('#e')).type, 'hashsym')
示例#15
0
 def test_symbol(self):
     self.assertEqual(next(visp.lex('foo%$!')).type, 'symbol')
示例#16
0
 def test_dot(self):
     self.assertEqual(
         next(visp.lex('.')).type,
         'dot')
示例#17
0
 def test_wspace(self):
     self.assertEqual(
         len(list(visp.lex('     '))),
         0)
示例#18
0
 def test_dot(self):
     self.assertEqual(next(visp.lex('.')).type, 'dot')