Lines Matching refs:_tokenize
41 def _tokenize(line): member in TokenizerTests
49 for token in TokenizerTests._tokenize('@include /minijail.policy')
56 for token in TokenizerTests._tokenize('@include ./minijail.policy')
62 [(token.type, token.value) for token in TokenizerTests._tokenize(
94 TokenizerTests._tokenize('%invalid-token%')
105 def _tokenize(self, line): member in ParseConstantTests
112 self.parser.parse_value(self._tokenize('0x80000000')), 0x80000000)
115 self.parser.parse_value(self._tokenize('0x8000000000000000')),
123 self.parser.parse_value(self._tokenize('0x100000000'))
126 self.parser.parse_value(self._tokenize('0x10000000000000000'))
131 self.parser.parse_value(self._tokenize('-1')),
139 self.parser.parse_value(self._tokenize('-0x800000001'))
141 self.parser.parse_value(self._tokenize('-0x8000000000000001'))
146 self.parser.parse_value(self._tokenize('0x1|0x2|0x4|0x8')), 0xf)
162 self.parser.parse_value(self._tokenize(expression))
170 tokens = self._tokenize(expression)
185 self.parser.parse_value(self._tokenize(expression)), 3)
190 self.parser.parse_value(self._tokenize('~0')),
193 self.parser.parse_value(self._tokenize('~0|~0')),
198 self._tokenize('~0x005AF0FF|~0xFFA50FFF')), 0xFFFFFF00)
201 self._tokenize('0x0F|~(0x005AF000|0x00A50FFF)|0xF0')),
206 self._tokenize('~0x00005A5AF0F0FFFF|~0xFFFFA5A50F0FFFFF')),
210 self._tokenize(
218 self.parser.parse_value(self._tokenize('~~0'))
223 self.parser.parse_value(self._tokenize('0|~'))
228 self.parser.parse_value(self._tokenize('O_RDONLY')), 0)
235 self.parser.parse_value(self._tokenize('0|'))
240 self.parser.parse_value(self._tokenize('foo'))
251 def _tokenize(self, line): member in ParseFilterExpressionTests
259 self._tokenize(
272 self._tokenize('arg0 in 0xffff ||'))
278 self._tokenize('arg0 in 0xffff &&'))
284 self._tokenize('argX in 0xffff'))
290 self._tokenize('arg0 = 0xffff'))
295 self.parser.parse_argument_expression(self._tokenize('arg0'))
300 self.parser.parse_argument_expression(self._tokenize('arg0 =='))
311 def _tokenize(self, line): member in ParseFilterTests
318 self.parser.parse_filter(self._tokenize('arg0 == 0')), [
322 self.parser.parse_filter(self._tokenize('kill-process')), [
326 self.parser.parse_filter(self._tokenize('kill-thread')), [
330 self.parser.parse_filter(self._tokenize('trap')), [
334 self.parser.parse_filter(self._tokenize('return ENOSYS')), [
339 self.parser.parse_filter(self._tokenize('trace')), [
343 self.parser.parse_filter(self._tokenize('log')), [
347 self.parser.parse_filter(self._tokenize('allow')), [
351 self.parser.parse_filter(self._tokenize('1')), [
356 self._tokenize(
369 self.parser.parse_filter(self._tokenize('return'))
374 self.parser.parse_filter(self._tokenize('return arg0'))
379 self.parser.parse_filter(self._tokenize('{ allow'))
390 def _tokenize(self, line): member in ParseFilterStatementTests
398 self._tokenize('read: arg0 == 0')),
404 self._tokenize('{read, write}: arg0 == 0')),
413 self._tokenize('io@libc: arg0 == 0')),
422 self._tokenize('file-io@systemd: arg0 == 0')),
434 self._tokenize('read[arch=test]: arg0 == 0')),
440 self._tokenize(
449 self.parser.parse_filter(self._tokenize('{ allow'))
455 self._tokenize('{ read, write: arg0 == 0'))
460 self.parser.parse_filter_statement(self._tokenize('read'))
465 self.parser.parse_filter_statement(self._tokenize('read arg0'))
470 self.parser.parse_filter_statement(self._tokenize('read:'))