Move example grammars from fixtures -> examples dir

This commit is contained in:
Max Brunsfeld 2014-02-17 13:15:52 -08:00
parent 585f9f0054
commit fd757c20d0
8 changed files with 60 additions and 68 deletions

View file

@ -0,0 +1,22 @@
#include "spec_helper.h"
#include "../../examples/grammars/json.hpp"
#include "../../examples/grammars/arithmetic.hpp"
#include <fstream>
START_TEST
describe("compiling the example grammars", []() {
string example_parser_dir = src_dir() + "/examples/parsers/";
it("compiles the arithmetic grammar", [&]() {
Grammar grammar = test_grammars::arithmetic();
ofstream(example_parser_dir + "arithmetic.c") << compile(grammar, "arithmetic");
});
it("compiles the json grammar", [&]() {
Grammar grammar = test_grammars::json();
ofstream(example_parser_dir + "json.c") << compile(grammar, "json");
});
});
END_TEST