diff options
Diffstat (limited to 'tests/serd_test.c')
-rw-r--r-- | tests/serd_test.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 2acf24b0..434c2ffa 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -225,11 +225,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_byte_source_free(byte_source); serd_sink_free(sink); |