Beispiel #1
0
class TestConsume(TestCase):
    def setUp(self):
        self.ob = Parser(None,None)
        
    def test_consume_token(self):
        self.ob.consumeToken()
        assert self.ob.currentFlaggedToken == Token.EOF
        
    def test_consume_token2(self):
        self.ob.currentFlaggedToken = 100000
        self.ob.consumeToken()
        assert self.ob.currentFlaggedToken == Token.EOF
Beispiel #2
0
class TestJSSnippets(TestCase):
    def setUp(self):
        ce = CompilerEnvirons()
        er = ErrorReporter()
        self.parser = Parser(ce, er)
        
    def _parsesOk(self, instr):
        try:
            self.parser.parse(instr+"\n", None, 1)
        except Exception, e:
            print e
            return False
        return True
Beispiel #3
0
 def setUp(self):
     self.ob = Parser(None,None)
Beispiel #4
0
 def setUp(self):
     ce = CompilerEnvirons()
     er = ErrorReporter()
     self.parser = Parser(ce, er)