Consolidate reading of input chunks in parser

This commit is contained in:
Max Brunsfeld 2014-03-11 08:30:19 -07:00
parent 42e9a264f3
commit ff0c8a98b8
4 changed files with 17 additions and 17 deletions

View file

@ -7,12 +7,12 @@ START_TEST
describe("reading from an input", [&]() {
ts_document *doc;
before_each([&]() {
doc = ts_document_make();
ts_document_set_parser(doc, ts_parse_config_json);
});
after_each([&]() {
ts_document_free(doc);
});
@ -20,7 +20,7 @@ describe("reading from an input", [&]() {
it("reads the entire input", [&]() {
SpyReader reader("\"ok go do it!\"", 3);
ts_document_set_input(doc, reader.input);
AssertThat(string(ts_document_string(doc)), Equals("(value (string))"));
AssertThat(reader.chunks_read, Equals(vector<string>({
"\"ok",