diff options
author | Haibo Huang <hhb@google.com> | 2018-08-28 14:53:55 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-08-28 14:53:55 -0700 |
commit | 1a86e8ee41328e77cecf1b887d5eb616dbf77d0a (patch) | |
tree | 8cacab926d75eb6906a1c6c4c18489648e264709 /runtime/Python/tests/t030specialStates.py | |
parent | 47bcf635f6793781ce4e6d080a4e804546e63597 (diff) | |
parent | b3f47eb6ae3fd805a1ce98c5b5125cb8c443af05 (diff) | |
download | antlr-1a86e8ee41328e77cecf1b887d5eb616dbf77d0a.tar.gz |
Merge "Move files in antlr to match upstream directory structure" am: bbed35ef4b am: 32d1488b05
am: b3f47eb6ae
Change-Id: I81ad1bf0e91c98ee403434178cb0b9194904d8b5
Diffstat (limited to 'runtime/Python/tests/t030specialStates.py')
-rw-r--r-- | runtime/Python/tests/t030specialStates.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/runtime/Python/tests/t030specialStates.py b/runtime/Python/tests/t030specialStates.py new file mode 100644 index 0000000..86c4f7c --- /dev/null +++ b/runtime/Python/tests/t030specialStates.py @@ -0,0 +1,47 @@ +import antlr3 +import testbase +import unittest + + +class t030specialStates(testbase.ANTLRTest): + def setUp(self): + self.compileGrammar() + + + def testValid1(self): + cStream = antlr3.StringStream('foo') + lexer = self.getLexer(cStream) + tStream = antlr3.CommonTokenStream(lexer) + parser = self.getParser(tStream) + events = parser.r() + + + def testValid2(self): + cStream = antlr3.StringStream('foo name1') + lexer = self.getLexer(cStream) + tStream = antlr3.CommonTokenStream(lexer) + parser = self.getParser(tStream) + events = parser.r() + + + def testValid3(self): + cStream = antlr3.StringStream('bar name1') + lexer = self.getLexer(cStream) + tStream = antlr3.CommonTokenStream(lexer) + parser = self.getParser(tStream) + parser.cond = False + events = parser.r() + + + def testValid4(self): + cStream = antlr3.StringStream('bar name1 name2') + lexer = self.getLexer(cStream) + tStream = antlr3.CommonTokenStream(lexer) + parser = self.getParser(tStream) + parser.cond = False + events = parser.r() + + +if __name__ == '__main__': + unittest.main() + |