Move example grammars from fixtures -> examples dir
This commit is contained in:
parent
585f9f0054
commit
fd757c20d0
8 changed files with 60 additions and 68 deletions
22
spec/compiler/compile_examples.cpp
Normal file
22
spec/compiler/compile_examples.cpp
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue