diff options
author | David Robillard <d@drobilla.net> | 2020-06-28 23:26:48 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-08 23:23:06 -0500 |
commit | b7948f8c9ad54c30e2579fd5da4626c6f3de325a (patch) | |
tree | 9de00308f9c0d5aa0c3587ac9f4eab7724e71484 /test/test_read_chunk.c | |
parent | 4e7e642d0d7b6dfa704f5ae95475854bb8c9b0b2 (diff) | |
download | serd-b7948f8c9ad54c30e2579fd5da4626c6f3de325a.tar.gz serd-b7948f8c9ad54c30e2579fd5da4626c6f3de325a.tar.bz2 serd-b7948f8c9ad54c30e2579fd5da4626c6f3de325a.zip |
WIP: Make Reader always read from a ByteSource
Diffstat (limited to 'test/test_read_chunk.c')
-rw-r--r-- | test/test_read_chunk.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/test/test_read_chunk.c b/test/test_read_chunk.c index 1bbe2709..1cb19aaf 100644 --- a/test/test_read_chunk.c +++ b/test/test_read_chunk.c @@ -94,20 +94,22 @@ main(void) SerdWorld* world = serd_world_new(); SerdSink* sink = serd_sink_new(NULL, on_event, NULL); + SerdByteSource* byte_source = + serd_byte_source_new_string("@prefix eg: <http://example.org/> .\n" + "@base <http://example.org/base> .\n" + "eg:s1 eg:p1 eg:o1 ;\n" + " eg:p2 eg:o2 ,\n" + " eg:o3 .\n" + "eg:s2 eg:p1 eg:o1 ;\n" + " eg:p2 eg:o2 .\n" + "eg:s3 eg:p1 eg:o1 .\n" + "eg:s4 eg:p1 [ eg:p3 eg:o1 ] .\n", + NULL); + SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096); assert(reader); - assert(!serd_reader_start_string(reader, - "@prefix eg: <http://example.org/> .\n" - "@base <http://example.org/base> .\n" - "eg:s1 eg:p1 eg:o1 ;\n" - " eg:p2 eg:o2 ,\n" - " eg:o3 .\n" - "eg:s2 eg:p1 eg:o1 ;\n" - " eg:p2 eg:o2 .\n" - "eg:s3 eg:p1 eg:o1 .\n" - "eg:s4 eg:p1 [ eg:p3 eg:o1 ] .\n", - NULL)); + assert(!serd_reader_start(reader, byte_source)); assert(!serd_reader_read_chunk(reader) && n_prefix == 1); assert(!serd_reader_read_chunk(reader) && n_base == 1); @@ -121,6 +123,7 @@ main(void) assert(!serd_reader_finish(reader)); serd_reader_free(reader); + serd_byte_source_free(byte_source); serd_sink_free(sink); serd_world_free(world); |