tree-sitter/spec/compiler/compile_fixtures.cpp
Max Brunsfeld 5776846227 Make compile take a name argument
Start work on JSON fixture grammar
2014-01-23 13:48:07 -08:00

22 lines
No EOL
628 B
C++

#include "spec_helper.h"
#include "compile.h"
#include "../fixtures/grammars/test_grammars.h"
#include <fstream>
START_TEST
describe("compiling grammars", []() {
string test_parser_dir = src_dir() + "/spec/fixtures/parsers";
it("works for the arithmetic grammar", [&]() {
Grammar grammar = test_grammars::arithmetic();
ofstream(test_parser_dir + "/arithmetic.c") << compile(grammar, "arithmetic");
});
it("works for the json grammar", [&]() {
Grammar grammar = test_grammars::json();
ofstream(test_parser_dir + "/json.c") << compile(grammar, "json");
});
});
END_TEST