2014-01-11 15:14:17 -08:00
|
|
|
#include "spec_helper.h"
|
|
|
|
|
#include "compile.h"
|
|
|
|
|
#include "../fixtures/grammars/arithmetic.h"
|
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
|
|
START_TEST
|
|
|
|
|
|
2014-01-11 17:59:45 -08:00
|
|
|
describe("compiling grammars", []() {
|
2014-01-11 15:14:17 -08:00
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
END_TEST
|