Consolidate reading of input chunks in parser
This commit is contained in:
parent
42e9a264f3
commit
ff0c8a98b8
4 changed files with 17 additions and 17 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue