From 2f41f6609a4b0f9d7b0cdac83950d04a2ba6986b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 30 Sep 2020 12:11:39 +0200 Subject: WIP: Test reading string EOF as chunk --- tests/serd_test.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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( + " " + " , _: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); -- cgit v1.2.1