diff options
Diffstat (limited to 'test/test_reader_writer.c')
-rw-r--r-- | test/test_reader_writer.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c index 58ea1944..ac9d8fc2 100644 --- a/test/test_reader_writer.c +++ b/test/test_reader_writer.c @@ -211,11 +211,24 @@ test_read_string(void) // Test reading a string that ends exactly at the end of input (no newline) assert(!serd_reader_start(reader, byte_source)); - assert(!serd_reader_read_document(reader)); assert(n_statements == 1); assert(!serd_reader_finish(reader)); + // Test reading the same but as a chunk + serd_byte_source_free(byte_source); + n_statements = 0; + byte_source = + serd_byte_source_new_string("<http://example.org/s> <http://example.org/p> " + "<http://example.org/o> , _:blank .", + NULL); + + assert(!serd_reader_start(reader, byte_source)); + assert(!serd_reader_read_chunk(reader)); + assert(n_statements == 2); + assert(serd_reader_read_chunk(reader) == SERD_FAILURE); + assert(!serd_reader_finish(reader)); + serd_reader_free(reader); serd_env_free(env); serd_byte_source_free(byte_source); |