Exemplo n.º 1
0
 def test_parse(self):
     s = "(heap (id 1)(seed 1)(size 2)(input_port 3)(output_port 4))"
     l = lex.Lexer(mocks.MockFile(s))
     result = benchmarks.parse_benchmark(l)
     self.assertEqual(str(result), s)
Exemplo n.º 2
0
 def test_parse(self):
     s = "(trace (id 3)(name test))"
     l = lex.Lexer(mocks.MockFile(s))
     result = benchmarks.parse_benchmark(l)
     self.assertEqual(str(result), s)
Exemplo n.º 3
0
 def test_parse(self):
     s = "(qsort (id 9)(seed 3)(size 16)(input_port 1)(output_port 2))"
     l = lex.Lexer(mocks.MockFile(s))
     result = benchmarks.parse_benchmark(l)
     self.assertEqual(str(result), s)
Exemplo n.º 4
0
 def test_parse(self):
     s = "(maze (id 1)(seed 1)(width 2)(height 3))"
     l = lex.Lexer(mocks.MockFile(s))
     result = benchmarks.parse_benchmark(l)
     self.assertEqual(str(result), s)
Exemplo n.º 5
0
Arquivo: model.py Projeto: hoangt/ms3
def _parse_benchmarks(lexer):
    bms = []
    while lexer.get_type() == lex.TOKEN_OPEN:
        bms.append(benchmarks.parse_benchmark(lexer))
    return bms
Exemplo n.º 6
0
 def test_parse(self):
     s = "(hash (id 2)(seed 3)(count 10)(input_port 5)(output_port 6))"
     l = lex.Lexer(mocks.MockFile(s))
     result = benchmarks.parse_benchmark(l)
     self.assertEqual(str(result), s)