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)
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)
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)
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)
def _parse_benchmarks(lexer): bms = [] while lexer.get_type() == lex.TOKEN_OPEN: bms.append(benchmarks.parse_benchmark(lexer)) return bms
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)