The JSON-LD Test Suite is a set of tests that can be used to verify JSON-LD Processor conformance to the set of specifications that constitute JSON-LD. The goal of the suite is to provide an easy and comprehensive JSON-LD testing solution for developers creating JSON-LD Processors.
Tests are for framing:
frame tests have input, frame and expected documents. The expected results can be compared using JSON-LD object comparison with the processor output. Additionally, if the
ordered option is not set, result should be expanded and compared with the expanded expected document also using JSON-LD object comparison.
For NegativeEvaluationTests, the result is a string associated with the expected error code.
processingMode is set explicitly in a test entry,
processingMode is compatible with both
Test results that include a context input presume that the context is provided locally, and not from the referenced location, thus the results will include the content of the context file, rather than a reference.
If algorithms are invoked with the
ordered flag set to
true, simple JSON Object comparison may be used, as the order of all arrays will be preserved (except for fromRdf, unless the input quads are also ordered). If
false, then the following algorithm will ensure arrays other than values of
@list are compared without regard to order.
JSON-LD Object comparison compares JSON objects, arrays, and values recursively for equality.
@list). Each item within the array must be equivalent to an item in the array being compared to by using the comparison algorithm recursively. For values of
@list, the order of these items is significant.
Note that some tests require re-expansion and comparison, as list values may exist as values of properties that have
@container: @list and the comparison algorithm will not consider ordering significant.
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:
@list. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).
If you would like to contribute a new test or a fix to an existing test, please follow these steps: