aboutsummaryrefslogtreecommitdiffstats
path: root/tests/env_test.c
AgeCommit message (Collapse)AuthorFilesLines
2020-10-27Make serd_env_expand() always return a node if it is not relativeDavid Robillard1-34/+152
The old interface was potentially faster, because it avoided unnecessary copies, but was annoying to use and problematic because nodes that don't need expansion were indistinguishable from nodes that failed to expand (like those that use undefined namespace prefixes). In the grand scheme of things, the potential performance improvement isn't worth it, and unexpected unexpanded nodes causes deep nightmarish problems, so just make serd_env_expand() copy the input if it doesn't need expansion to make the API simpler and safer.
2020-10-27Clean up Env tests and behaviourDavid Robillard1-77/+184
2020-10-27Make const Env functions tolerant of NULLDavid Robillard1-0/+4
This is convenient in places where you don't necessarily need an Env, since in this case these methods work the same as if with an empty Env.
2020-10-27Replace multiple stream callbacks with SerdEventDavid Robillard1-5/+5
This makes plumbing easier since everything goes through the same "stream" and only one callback is required to handling everything. It's also more easily extensible in case more event types need to be added in the future.
2020-10-27Add function to SerdSink for freeing opaque handleDavid Robillard1-1/+1
This can be used to associate dynamically allocated data with a sink and have it managed along with the sink's lifetime.
2020-10-27Use public sink interface in readerDavid Robillard1-0/+1
2020-10-27Remove serd_env_foreach()David Robillard1-2/+4
This is not particularly useful except to write prefixes, which is what serd_env_write_prefixes is for, and the name implies that namespace prefixes are the only thing in an Env, which will be problematic in the future.
2020-10-27Ensure serd_new_resolved_uri returns an absolute URI or NULLDavid Robillard1-1/+3
2020-10-27Add serd_env_copy() and serd_env_equals()David Robillard1-0/+19
2020-10-27Simplify SerdEnv APIDavid Robillard1-24/+29
2020-10-27Shorten node constructor namesDavid Robillard1-9/+9
2020-10-27Clean up node construction APIDavid Robillard1-10/+17
2020-10-27Add blank node APIDavid Robillard1-0/+3
2020-10-27Make nodes opaqueDavid Robillard1-29/+37
2020-10-27Remove "get" from accessor namesDavid Robillard1-1/+1
2020-10-27Rename SerdChunk to SerdStringViewDavid Robillard1-2/+2
2020-10-27Use char* for strings in public APIDavid Robillard1-14/+11
The constant casting just makes user code a mess, for no benefit.
2020-08-16Move Env tests to a separate fileDavid Robillard1-0/+95