Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: mojo/public/tools/bindings/pylib/mojom_tests/parse/lexer_unittest.py

Issue 272323003: Mojo: Implement support for |Foo&| mojom syntax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import imp 5 import imp
6 import os.path 6 import os.path
7 import sys 7 import sys
8 import unittest 8 import unittest
9 9
10 # Disable lint check for finding modules: 10 # Disable lint check for finding modules:
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 self.assertEquals(self._SingleTokenForInput("|"), 136 self.assertEquals(self._SingleTokenForInput("|"),
137 _MakeLexToken("OR", "|")) 137 _MakeLexToken("OR", "|"))
138 self.assertEquals(self._SingleTokenForInput("~"), 138 self.assertEquals(self._SingleTokenForInput("~"),
139 _MakeLexToken("NOT", "~")) 139 _MakeLexToken("NOT", "~"))
140 self.assertEquals(self._SingleTokenForInput("^"), 140 self.assertEquals(self._SingleTokenForInput("^"),
141 _MakeLexToken("XOR", "^")) 141 _MakeLexToken("XOR", "^"))
142 self.assertEquals(self._SingleTokenForInput("<<"), 142 self.assertEquals(self._SingleTokenForInput("<<"),
143 _MakeLexToken("LSHIFT", "<<")) 143 _MakeLexToken("LSHIFT", "<<"))
144 self.assertEquals(self._SingleTokenForInput(">>"), 144 self.assertEquals(self._SingleTokenForInput(">>"),
145 _MakeLexToken("RSHIFT", ">>")) 145 _MakeLexToken("RSHIFT", ">>"))
146 self.assertEquals(self._SingleTokenForInput("&"),
147 _MakeLexToken("AMP", "&"))
146 self.assertEquals(self._SingleTokenForInput("="), 148 self.assertEquals(self._SingleTokenForInput("="),
147 _MakeLexToken("EQUALS", "=")) 149 _MakeLexToken("EQUALS", "="))
148 self.assertEquals(self._SingleTokenForInput("=>"), 150 self.assertEquals(self._SingleTokenForInput("=>"),
149 _MakeLexToken("RESPONSE", "=>")) 151 _MakeLexToken("RESPONSE", "=>"))
150 self.assertEquals(self._SingleTokenForInput("("), 152 self.assertEquals(self._SingleTokenForInput("("),
151 _MakeLexToken("LPAREN", "(")) 153 _MakeLexToken("LPAREN", "("))
152 self.assertEquals(self._SingleTokenForInput(")"), 154 self.assertEquals(self._SingleTokenForInput(")"),
153 _MakeLexToken("RPAREN", ")")) 155 _MakeLexToken("RPAREN", ")"))
154 self.assertEquals(self._SingleTokenForInput("["), 156 self.assertEquals(self._SingleTokenForInput("["),
155 _MakeLexToken("LBRACKET", "[")) 157 _MakeLexToken("LBRACKET", "["))
(...skipping 28 matching lines...) Expand all
184 def _SingleTokenForInput(self, input_string): 186 def _SingleTokenForInput(self, input_string):
185 """Gets the single token for the given input string. (Raises an exception if 187 """Gets the single token for the given input string. (Raises an exception if
186 the input string does not result in exactly one token.)""" 188 the input string does not result in exactly one token.)"""
187 toks = self._TokensForInput(input_string) 189 toks = self._TokensForInput(input_string)
188 assert len(toks) == 1 190 assert len(toks) == 1
189 return toks[0] 191 return toks[0]
190 192
191 193
192 if __name__ == "__main__": 194 if __name__ == "__main__":
193 unittest.main() 195 unittest.main()
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/pylib/mojom/parse/translate.py ('k') | mojo/services/native_viewport/native_viewport.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698