From f7c7115e0555f25e0f2c6d09378b66aec2d41d76 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 --- test/test_reader_writer.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test') 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(" " + " , _: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); -- cgit v1.2.1