diff test/testc3.py @ 396:fb3c1f029b30

Added baselexer into c3 lexer
author Windel Bouwman
date Tue, 27 May 2014 22:19:32 +0200
parents 6ae782a085e0
children
line wrap: on
line diff
--- a/test/testc3.py	Fri May 23 14:28:03 2014 +0200
+++ b/test/testc3.py	Tue May 27 22:19:32 2014 +0200
@@ -14,10 +14,10 @@
     def testUnexpectedCharacter(self):
         snippet = io.StringIO(""" var s \u6c34 """)
         with self.assertRaises(ppci.CompilerError):
-            list(self.l.tokenize(snippet))
+            list(self.l.lex(snippet))
 
     def check(self, snippet, toks):
-        toks2 = list(tok.typ for tok in self.l.tokenize(io.StringIO(snippet)))
+        toks2 = list(tok.typ for tok in self.l.lex(io.StringIO(snippet)))
         self.assertSequenceEqual(toks, toks2)
 
     def testBlockComment(self):
@@ -25,7 +25,7 @@
           /* Demo */
           var int x = 0;
         """
-        toks = ['var', 'ID', 'ID', '=', 'NUMBER', ';', 'END']
+        toks = ['var', 'ID', 'ID', '=', 'NUMBER', ';', 'EOF']
         self.check(snippet, toks)
 
     def testBlockCommentMultiLine(self):
@@ -36,7 +36,7 @@
           */
           var int x = 0;
         """
-        toks = ['var', 'ID', 'ID', '=', 'NUMBER', ';', 'END']
+        toks = ['var', 'ID', 'ID', '=', 'NUMBER', ';', 'EOF']
         self.check(snippet, toks)
 
 
@@ -69,7 +69,6 @@
         if rows != actualErrors:
             self.diag.printErrors()
         self.assertSequenceEqual(rows, actualErrors)
-        # self.assertFalse(all(ircode))
 
     def expectOK(self, snippet):
         """ Expect a snippet to be OK """