ActivityPub says
Every object MAY have a likes collection. … The likes collection MUST be either an OrderedCollection or a Collection
This is a Test Case describing a rule to determine whether an ActivityPub Object is in partial conformance with the following behaviors required by ActivityPub.
The identifier of this test is urn:uuid:200b9bc8-aae3-46f2-a6ab-5366042c0f6e.
The subject of this test is an ActivityPub Object.
This test requires the following inputs indicating parts of the test subject:
input.objectthe object whose likes property will be tested
This test applies to each of the likes collections derived from the values of the property on object named likes.
object is a JSON objectobject JSON object has a property named likesHow to Derive Test Targets from Input
targets be a setlikesValues be the result of
object.likes is an Array, return itobject.likeslikesValues
targetstargetstargetsFor every target target
target is a JSON objecttarget has a property named typetarget's type property must be one of
What follows are some specific cases of applything this test rule.
inputs
object:
{
"likes": {
"type": "Collection"
}
}
test targets
{
"type": "Collection"
}
passedinputs
object:
{
"likes": {
"type": "OrderedCollection"
}
}
test targets
{
"type": "OrderedCollection"
}
passedinputs
object:
{
"likes": {
"type": ["FancyCollection", "OrderedCollection"]
}
}
test targets
{
"likes": {
"type": ["FancyCollection", "OrderedCollection"]
}
}
passed
"FancyCollection" is not well-defined here, but this object still passes the test because at least one of the type property values is OrderedCollection and thus satisfies the requirement as interpreted.inputs
object:
{
"likes": 1
}
test targets
1
failedinputs
object:
{
"likes": {}
}
test targets
{}
failed"Link"inputs
object:
{
"likes": {
"type": ["Link"]
}
}
test targets
{
"type": ["Link"]
}
failedinputs
object:
1
result
inapplicableinputs
object:
{ "foo": "bar" }
result
inapplicableinputs
object:
<!doctype html>hi
result
inapplicableoutcomeAn outcome is a conclusion that comes from evaluating a test on a test subject. An outcome can be one of the three following types:
inapplicable: No part of the test subject matches the applicabilitypassed: A test target meets all expectationsfailed: A test target does not meet all expectationspassed, the requirement is satisfied by the test subjectfailed, the requirement is not satisfied by the test subjectinapplicable, further testing is needed to determine requirement satisfaction