aboutsummaryrefslogtreecommitdiff
path: root/runtime/Python/tests/t030specialStates.py
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2018-08-28 14:01:36 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-08-28 14:01:36 -0700
commitb3f47eb6ae3fd805a1ce98c5b5125cb8c443af05 (patch)
tree8cacab926d75eb6906a1c6c4c18489648e264709 /runtime/Python/tests/t030specialStates.py
parent4eceaa33589c1f8277bd7ad48073da87d4134681 (diff)
parent32d1488b05603717c1bedd10d08bdde5587eca00 (diff)
downloadantlr-b3f47eb6ae3fd805a1ce98c5b5125cb8c443af05.tar.gz
Merge "Move files in antlr to match upstream directory structure" am: bbed35ef4b
am: 32d1488b05 Change-Id: I48c299878b3a8f74e98454268cb1d9da0d19ac74
Diffstat (limited to 'runtime/Python/tests/t030specialStates.py')
-rw-r--r--runtime/Python/tests/t030specialStates.py47
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()
+