RE: Testing API options

On Friday, August 23, 2013 9:42 PM, Dave Longley wrote:
> I have some fairly old tests (and only a few) in jsonld.js that do
> remote context resolution; I don't know how useful it is to look at them:
>
https://github.com/digitalbazaar/jsonld.js/blob/master/tests/manifest.jsonld
>
> I don't think the feature should be optional.

Actually you are right, I agree it shouldn't be optional for conformant
implementations. Of course, some implementations may choose to leave it out
nevertheless.


> We could provide a function name and then describe what the function
> must do/provide example code -- which, I assume, is what Gregg was
suggesting.
> We could also define the test function as one that just returns test
contexts
> from an in-memory map.

That's a great idea. We can define the behavior of the callback and make it
part of the test runner. We don't even need a name in that case, let's keep
it as simple as possible. There's one such callback. If it should be used,
we simply set a "useDocumentLoader" flag to true. The reason for not using
documentLoader directly is to allow implementations in different programming
languages. The definition of that callback defines what it returns for a
number of URLs and what happens for unknown URLs.


--
Markus Lanthaler
@markuslanthaler

Received on Saturday, 24 August 2013 10:22:11 UTC