diff --git a/tests/microformats-v2-unit/README.md b/tests/microformats-v2-unit/README.md new file mode 100644 index 0000000..869682c --- /dev/null +++ b/tests/microformats-v2-unit/README.md @@ -0,0 +1,29 @@ +# Microformats v2 unit tests + +This directory contains a set of "unit tests" for microformats parsers. Where other tests seek to demonstrate correct behaviour for real-world documents, these tests are purely synthetic, and aim to test individual parsing features in detail. + +## Design principles + +Tests adhere to the following design principles. New additions to this test series should follow these principles wherever possible, and document deviations in HTML comments where applicable. + +- As much as possible each file should test only one parsing feature. Due to the requirements of microformats parsing this can often be difficult to accomplish. In particular, the following should be avoided in test output: + - Implied properties: where the parser would imply a `p-name` or other property, add an explicit one + - Text trimming: Any text output should avoid inner or outer whitespace which the traditional or [more aggressive](https://microformats.org/wiki/textcontent-parsing) triming algorithms would remove. At the very least, tests should pass regardless of which algorithm is used + - URL normalization: URLs should be kept simple, as the details of expected normalization are undefined as of this writing +- Where the specification is silent or unclear as to the expected behaviour of a feature but most implementations agree, tests should be placed into a file named beginning with `tentative-` e.g. `tentative-some-feature.html` to allow implementations to easily skip these tests if they do not implement the majority behaviour. Such files should include HTML comments with explanatory details and references to any relevant GitHub issues or other discussion +- Top-level microformat types should include "test" within their name. For example, use `h-test-explicit` rather than `h-explicit` +- Top-level microformat types should be unique per file, so that failing tests can have unique identifiers. In other words, do not use `h-test` for every microformat; instead use `h-1-test` and `h-2-test`, or even better `h-test-with-feature` and `h-test-without-feature` +- Test failure should be indicated with the inclusion of "Invalid" in the output, wherever possible. Test success may be indicated with the inclusion of the text "Valid", but other text may be used where suitable +- Where the parser is expected to trim attribute values, the text "Do Trim" should be used in the output. Conversely, where the parser is expected not to trim attribute values, the text " No Trim " should be used in the output +- The implied base URL is `http://example.test`. The `example.test` domain is used instead of `example.com` as in other tests since `example.com` is an actual host on the Internet and implementations might conceivably communicate with it automatically. This may change if consensus emerges that `example.com` is nevertheless preferred + +## Setting up the tests + +Test set-up is the same as for the other test sets, with the exception that the base URL is `http://example.test`. Partial parser implementations may wish to execute tests in a particular orderto test basic features before more complex ones: + +1. Microformat tests in `names` +2. Property tests in `names` +3. Tests in `properties` +4. Tests in `implied` +5. Tests in `value` +6. Tests in `nested` \ No newline at end of file diff --git a/tests/microformats-v2-unit/implied/implied-name.html b/tests/microformats-v2-unit/implied/implied-name.html new file mode 100644 index 0000000..a7e9df0 --- /dev/null +++ b/tests/microformats-v2-unit/implied/implied-name.html @@ -0,0 +1,233 @@ + + + +
+
Valid
Invalid +
+ +
+
NotPartOfTest
Invalid +
+ +
+
NotPartOfTest
Invalid +
+ +
+
+
NotPartOfTest
Invalid +
Invalid +
+ +
+
NotPartOfTestNotPartOfTest
Invalid +
+ + +Valid + Do Trim + + + +Valid + Do Trim + + + +Invalid +Invalid +Invalid +Valid + + +
Valid
+
Valid
+ + +
ValidInvalid
+
 Do Trim Invalid
+
Valid
+
Valid
+

Alt Valid
+
Alt
Valid
+ +
ValidInvalid
+
 Do Trim Invalid
+
Valid
+
Valid
+

ValidValid
+
Valid
Valid
+ +
Invalid
+
Invalid
+
Valid
+
Valid
+

Valid
+
Valid
+ +
ValidInvalid
+
 Do Trim Invalid
+
Valid
+
Valid
+

Alt Valid
+
Alt
Valid
+

Alt Valid
+
Alt Valid

+ +
ValidInvalid
+
 Do Trim Invalid
+
Valid
+
Valid
+

InvalidValid
+
Invalid
Valid
+

InvalidValid
+
InvalidValid

+ +
Invalid
+
Invalid
+
Valid
+
Valid
+

Valid
+
Valid
+

Valid
+
Valid

+ + +ValidInvalid + Do Trim Invalid +Valid +Valid +
Alt Valid
+Alt
Valid
+ +ValidInvalid + Do Trim Invalid +Valid +Valid +
InvalidValid
+Invalid
Valid
+ +Invalid +Invalid +Valid +Valid +
Valid
+Valid
+ +
ValidInvalid
+
 Do Trim Invalid
+
Valid
+
Valid
+

Alt Valid
+
Alt
Valid
+
Alt Valid
+
Alt Valid

+ +
ValidInvalid
+
 Do Trim Invalid
+
Valid
+
Valid
+

InvalidValid
+
Invalid
Valid
+
InvalidValid
+
InvalidValid

+ +
Invalid
+
Invalid
+
Valid
+
Valid
+

Valid
+
Valid
+
Valid
+
Valid

+ + +InvalidInvalid +Invalid +Invalid +
InvalidInvalid
+Invalid
Invalid
+ +InvalidInvalid +Invalid +Invalid +
InvalidInvalid
+Invalid
Invalid
+ +Invalid +Invalid +Invalid +
Invalid
+Invalid
+ +
InvalidInvalid
+
Invalid
+
Invalid
+

InvalidInvalid
+
Invalid
Invalid
+
InvalidInvalid
+
InvalidInvalid

+ +
InvalidInvalid
+
Invalid
+
Invalid
+

InvalidInvalid
+
Invalid
Invalid
+
InvalidInvalid
+
InvalidInvalid

+ +
Invalid
+
Invalid
+
Invalid
+

Invalid
+
Invalid
+
Invalid
+
Invalid

+ + +InvalidInvalid +Invalid +Invalid +
InvalidInvalid
+Invalid
Invalid
+ +InvalidInvalid +Invalid +Invalid +
InvalidInvalid
+Invalid
Invalid
+ +Invalid +Invalid +Invalid +
Invalid
+Invalid
+ +
InvalidInvalid
+
Invalid
+
Invalid
+

InvalidInvalid
+
Invalid
Invalid
+
InvalidInvalid
+
InvalidInvalid

+ +
InvalidInvalid
+
Invalid
+
Invalid
+

InvalidInvalid
+
Invalid
Invalid
+
InvalidInvalid
+
InvalidInvalid

+ +
Invalid
+
Invalid
+
Invalid
+

Invalid
+
Invalid
+
Invalid
+
Invalid

diff --git a/tests/microformats-v2-unit/implied/implied-name.json b/tests/microformats-v2-unit/implied/implied-name.json new file mode 100644 index 0000000..de49f2a --- /dev/null +++ b/tests/microformats-v2-unit/implied/implied-name.json @@ -0,0 +1,1777 @@ +{ + "items": [ + { + "type": [ + "h-test-explicit" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-has-p" + ], + "properties": { + "override": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-test-has-e" + ], + "properties": { + "override": [ + { + "html": "NotPartOfTest", + "value": "NotPartOfTest" + } + ] + } + }, + { + "type": [ + "h-test-nested" + ], + "properties": {}, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-nested-prop" + ], + "properties": { + "prop": [ + { + "value": "NotPartOfTestNotPartOfTest", + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-img-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-img-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-area-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-abbr-title" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-title-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-abbr-title-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-abbr-title-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-no-value" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-no-value-title" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychild-alt-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-img-onlychild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychild-alt-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-area-onlychild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlychild-title-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlychild-title-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-abbr-onlychild-title-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlychild-title-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchild-alt-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchild-alt-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlygrandchild-title-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlygrandchild-title-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-test-abbr-onlygrandchild-title-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlygrandchild-title-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlychild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlychild-alt-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-2-test-img-onlychild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlychild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlychild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlychild-alt-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-2-test-area-onlychild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlychild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlychild-title-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlychild-title-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlychild-title-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlychild-title-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlygrandchild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlygrandchild-alt-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-2-test-img-onlygrandchild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlygrandchild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-2-test-img-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Alt Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlygrandchild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlygrandchild-alt-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-2-test-area-onlygrandchild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlygrandchild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-area-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlygrandchild-title-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlygrandchild-title-filled-space" + ], + "properties": { + "name": [ + "Do Trim" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlygrandchild-title-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlygrandchild-title-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test-abbr-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlychild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlychild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlychild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlychild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlychild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlychild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlychild-title-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlychild-title-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlychild-title-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlychild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlychild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlygrandchild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlygrandchild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlygrandchild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-img-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlygrandchild-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlygrandchild-alt-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlygrandchild-alt-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-area-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlygrandchild-title-filled" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlygrandchild-title-empty" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlygrandchild-title-missing" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test-abbr-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-4-test-img-onlychild-alt-filled" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlychild-alt-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlychild-alt-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlychild-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlychild-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlychild-alt-filled" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlychild-alt-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlychild-alt-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlychild-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlychild-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlychild-title-filled" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlychild-title-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlychild-title-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlychild-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlychild-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlygrandchild-alt-filled" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlygrandchild-alt-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlygrandchild-alt-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-img-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlygrandchild-alt-filled" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlygrandchild-alt-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlygrandchild-alt-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-area-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlygrandchild-title-filled" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlygrandchild-title-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlygrandchild-title-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlygrandchild-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlygrandchild-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlygrandchild-parent-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-4-test-abbr-onlygrandchild-parent-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/implied/implied-photo.html b/tests/microformats-v2-unit/implied/implied-photo.html new file mode 100644 index 0000000..0b96f34 --- /dev/null +++ b/tests/microformats-v2-unit/implied/implied-photo.html @@ -0,0 +1,109 @@ + + + + +NameOnly + NameOnly + + +Valid + No Trim + + +Valid + No Trim + +Name +Name +Name +
NotPartOfTest
+
http://exaple.test/NotPartOfTest
+
Valid
+ +
+
+
NameOnly
+
 NameOnly
+
+
+
Valid
+
 No Trim
+
+
+
Valid
+
 No Trim
+
+
+

+

+
+
+
+ + + + +
+
Name
+
Name
+
Name
+
Name
+

Name
+
Name
+
NotPartOfTest
+
http://example.test/NameAndOverride
+
Valid
+Name +Name +Name + +
+
+
NameOnly
+
 NameOnly
+
+
+
Valid
+
 No Trim
+
+
+
Valid
+
 No Trim
+
+
+

+

+

+

+
+
+
+
+
+
+ +
+
Name
+
Name
+
Name
+
Name
+

Name
+
Name
+

Name
+
Name

+
NotPartOfTest
+
http://example.test/NameAndOverride
+
Valid
+
Name
+
Name
+
Name
diff --git a/tests/microformats-v2-unit/implied/implied-photo.json b/tests/microformats-v2-unit/implied/implied-photo.json new file mode 100644 index 0000000..e30af3e --- /dev/null +++ b/tests/microformats-v2-unit/implied/implied-photo.json @@ -0,0 +1,1195 @@ +{ + "items": [ + { + "type": [ + "h-test-img-src-missing-alt-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-src-missing-alt-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-src-missing-alt-filled" + ], + "properties": { + "name": [ + "NameOnly" + ] + } + }, + { + "type": [ + "h-test-img-src-missing-alt-filled-space" + ], + "properties": { + "name": [ + "NameOnly" + ] + } + }, + { + "type": [ + "h-test-img-src-empty-alt-missing" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-img-src-empty-alt-empty" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + { + "value": "http://example.test", + "alt": "" + } + ] + } + }, + { + "type": [ + "h-test-img-src-empty-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ], + "photo": [ + { + "value": "http://example.test", + "alt": "Valid" + } + ] + } + }, + { + "type": [ + "h-test-img-src-empty-alt-filled-space" + ], + "properties": { + "name": [ + "No Trim" + ], + "photo": [ + { + "value": "http://example.test", + "alt": " No Trim " + } + ] + } + }, + { + "type": [ + "h-test-img-src-filled-alt-missing" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-src-filled-alt-empty" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": "" + } + ] + } + }, + { + "type": [ + "h-test-img-src-filled-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": "Valid" + } + ] + } + }, + { + "type": [ + "h-test-img-src-filled-alt-filled-space" + ], + "properties": { + "name": [ + "No Trim" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": " No Trim " + } + ] + } + }, + { + "type": [ + "h-test-object-data-missing" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-object-data-empty" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-object-data-filled" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-data-filled-has-child" + ], + "properties": {}, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-object-data-filled-has-u" + ], + "properties": { + "override": [ + "http://exaple.test/NotPartOfTest" + ], + "name": [ + "http://exaple.test/NotPartOfTest" + ] + } + }, + { + "type": [ + "h-test-object-data-filled-has-photo" + ], + "properties": { + "photo": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-missing-alt-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-missing-alt-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-missing-alt-filled" + ], + "properties": { + "name": [ + "NameOnly" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-missing-alt-filled-space" + ], + "properties": { + "name": [ + "NameOnly" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-empty-alt-missing" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-empty-alt-empty" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + { + "value": "http://example.test", + "alt": "" + } + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-empty-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ], + "photo": [ + { + "value": "http://example.test", + "alt": "Valid" + } + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-empty-alt-filled-space" + ], + "properties": { + "name": [ + "No Trim" + ], + "photo": [ + { + "value": "http://example.test", + "alt": " No Trim " + } + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-filled-alt-missing" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-filled-alt-empty" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": "" + } + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-filled-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": "Valid" + } + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-src-filled-alt-filled-space" + ], + "properties": { + "name": [ + "No Trim" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": " No Trim " + } + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-type-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-type-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-nontype-sibling-before" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-nontype-sibling-after" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-has-child" + ], + "properties": { + "name": [ + { + "value": "", + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/ChildOnly" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-has-u" + ], + "properties": { + "override": [ + "http://example.test/NotPartOfTest" + ], + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-has-photo" + ], + "properties": { + "photo": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-root-object" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-root-object-with-data" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlychildoftype-root-object-with-data-empty" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-data-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-data-empty" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-data-filled" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-type-sibling-before" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-type-sibling-after" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-nontype-sibling-before" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-nontype-sibling-after" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-has-child" + ], + "properties": {}, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-object-onlychildoftype-has-u" + ], + "properties": { + "override": [ + "http://example.test/NameAndOverride" + ], + "name": [ + "http://example.test/NameAndOverride" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-has-photo" + ], + "properties": { + "photo": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-root-object" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-root-object-with-data" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlychildoftype-root-object-with-data-empty" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-missing-alt-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-missing-alt-empty" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-missing-alt-filled" + ], + "properties": { + "name": [ + "NameOnly" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-missing-alt-filled-space" + ], + "properties": { + "name": [ + "NameOnly" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-empty-alt-missing" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-empty-alt-empty" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + { + "value": "http://example.test", + "alt": "" + } + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-empty-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ], + "photo": [ + { + "value": "http://example.test", + "alt": "Valid" + } + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-empty-alt-filled-space" + ], + "properties": { + "name": [ + "No Trim" + ], + "photo": [ + { + "value": "http://example.test", + "alt": " No Trim " + } + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-filled-alt-missing" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-filled-alt-empty" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": "" + } + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-filled-alt-filled" + ], + "properties": { + "name": [ + "Valid" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": "Valid" + } + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-src-filled-alt-filled-space" + ], + "properties": { + "name": [ + "No Trim" + ], + "photo": [ + { + "value": "http://example.test/Valid", + "alt": " No Trim " + } + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-type-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-type-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-nontype-sibling-before" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-nontype-sibling-after" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-parent-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-parent-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-has-child" + ], + "properties": { + "name": [ + { + "value": "", + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/ChildOnly" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-has-u" + ], + "properties": { + "override": [ + "http://example.test/NotPartOfTest" + ], + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-has-photo" + ], + "properties": { + "photo": [ + "" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-root-object" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-root-object-with-data" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img-onlygrandchildoftype-root-object-with-data-empty" + ], + "properties": { + "name": [ + "" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-data-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-data-empty" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-data-filled" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-type-sibling-before" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-type-sibling-after" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-nontype-sibling-before" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-nontype-sibling-after" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-parent-sibling-before" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-parent-sibling-after" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-has-child" + ], + "properties": {}, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-has-u" + ], + "properties": { + "override": [ + "http://example.test/NameAndOverride" + ], + "name": [ + "http://example.test/NameAndOverride" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-has-photo" + ], + "properties": { + "photo": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-root-object" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-root-object-with-data" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object-onlygrandchildoftype-root-object-with-data-empty" + ], + "properties": { + "name": [ + "Name" + ], + "photo": [ + "http://example.test" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/implied/implied-url.html b/tests/microformats-v2-unit/implied/implied-url.html new file mode 100644 index 0000000..aedac62 --- /dev/null +++ b/tests/microformats-v2-unit/implied/implied-url.html @@ -0,0 +1,82 @@ + + + + + + +Name +Name +Name +
NotPartOfTest
+
http://exaple.test/NotPartOfTest
+
Valid
+ +
+
+
+
+
+

+

+
+
+
+ + + + +
+
Name
+
Name
+
Name
+
Name
+

Name
+
Name
+
NotPartOfTest
+
http://example.test/NameAndOverride
+
Valid
+Name +Name +Name + +
+
+
+
+
+

+

+

+

+
+
+
+
+
+
+ +
+
Name
+
Name
+
Name
+
Name
+

Name
+
Name
+

Name
+
Name

+
NotPartOfTest
+
http://example.test/NameAndOverride
+
Valid
+
Name
+
Name
+
Name
diff --git a/tests/microformats-v2-unit/implied/implied-url.json b/tests/microformats-v2-unit/implied/implied-url.json new file mode 100644 index 0000000..d305137 --- /dev/null +++ b/tests/microformats-v2-unit/implied/implied-url.json @@ -0,0 +1,847 @@ +{ + "items": [ + { + "type": [ + "h-test-area-href-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-href-empty" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-area-href-filled" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-href-missing" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-a-href-empty" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-a-href-filled" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-href-filled-has-child" + ], + "properties": {}, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-a-href-filled-has-u" + ], + "properties": { + "override": [ + "http://exaple.test/NotPartOfTest" + ], + "name": [ + "http://exaple.test/NotPartOfTest" + ] + } + }, + { + "type": [ + "h-test-a-href-filled-has-url" + ], + "properties": { + "url": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-href-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-href-empty" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-href-filled" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-type-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-type-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-nontype-sibling-before" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-nontype-sibling-after" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-has-child" + ], + "properties": { + "name": [ + { + "value": "", + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/ChildOnly" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-has-u" + ], + "properties": { + "override": [ + "http://example.test/NotPartOfTest" + ], + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-has-url" + ], + "properties": { + "url": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-root-a" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-root-a-with-href" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlychildoftype-root-a-with-href-empty" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-href-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-href-empty" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-href-filled" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-type-sibling-before" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-type-sibling-after" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-nontype-sibling-before" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-nontype-sibling-after" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-has-child" + ], + "properties": {}, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-a-onlychildoftype-has-u" + ], + "properties": { + "override": [ + "http://example.test/NameAndOverride" + ], + "name": [ + "http://example.test/NameAndOverride" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-has-url" + ], + "properties": { + "url": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-root-a" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-root-a-with-href" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlychildoftype-root-a-with-href-empty" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-href-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-href-empty" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-href-filled" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-type-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-type-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-nontype-sibling-before" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-nontype-sibling-after" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-parent-sibling-before" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-parent-sibling-after" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-has-child" + ], + "properties": { + "name": [ + { + "value": "", + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/ChildOnly" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-has-u" + ], + "properties": { + "override": [ + "http://example.test/NotPartOfTest" + ], + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-has-url" + ], + "properties": { + "url": [ + "" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-root-a" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-root-a-with-href" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area-onlygrandchildoftype-root-a-with-href-empty" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-href-missing" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-href-empty" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-href-filled" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-type-sibling-before" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-type-sibling-after" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-nontype-sibling-before" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-nontype-sibling-after" + ], + "properties": { + "name": [ + "Name" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-parent-sibling-before" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-parent-sibling-after" + ], + "properties": { + "name": [ + "Name" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-has-child" + ], + "properties": {}, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-has-u" + ], + "properties": { + "override": [ + "http://example.test/NameAndOverride" + ], + "name": [ + "http://example.test/NameAndOverride" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-has-url" + ], + "properties": { + "url": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-root-a" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-root-a" + ], + "properties": { + "name": [ + "" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-root-a-with-href" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-root-a-with-href" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-root-a-with-href-empty" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-a-onlygrandchildoftype-root-a-with-href-empty" + ], + "properties": { + "name": [ + "" + ], + "url": [ + "http://example.test" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/names/names-microformats-multi.html b/tests/microformats-v2-unit/names/names-microformats-multi.html new file mode 100644 index 0000000..94204f4 --- /dev/null +++ b/tests/microformats-v2-unit/names/names-microformats-multi.html @@ -0,0 +1,12 @@ +
Valid
+ +
Valid
+ + +
Valid
+ + +
Valid
+ + +
diff --git a/tests/microformats-v2-unit/names/names-microformats-multi.json b/tests/microformats-v2-unit/names/names-microformats-multi.json new file mode 100644 index 0000000..be63a59 --- /dev/null +++ b/tests/microformats-v2-unit/names/names-microformats-multi.json @@ -0,0 +1,53 @@ +{ + "items": [ + { + "type": [ + "h-a" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-aa", + "h-bb", + "h-cc" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-aaa", + "h-bbb", + "h-ccc", + "h-ddd" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-1-test", + "h-11-test", + "h-2-test" + ], + "properties": { + "name": [ + "Valid" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/names/names-microformats.html b/tests/microformats-v2-unit/names/names-microformats.html new file mode 100644 index 0000000..037cf6e --- /dev/null +++ b/tests/microformats-v2-unit/names/names-microformats.html @@ -0,0 +1,58 @@ + +
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+ + +
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+ + +
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+
NotPartOfTest
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/microformats-v2-unit/names/names-microformats.json b/tests/microformats-v2-unit/names/names-microformats.json new file mode 100644 index 0000000..0941f79 --- /dev/null +++ b/tests/microformats-v2-unit/names/names-microformats.json @@ -0,0 +1,166 @@ +{ + "items": [ + { + "type": [ + "h-t" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-test-three" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-test-test-four" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-test-five-t" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-6-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-7t-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-8t8-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-t9-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-t10-test-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-t11t-test-t" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-t12-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-t13-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-t14-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-t15-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + }, + { + "type": [ + "h-t16-test" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/names/names-properties-multi.html b/tests/microformats-v2-unit/names/names-properties-multi.html new file mode 100644 index 0000000..7571cbe --- /dev/null +++ b/tests/microformats-v2-unit/names/names-properties-multi.html @@ -0,0 +1,12 @@ +
+
Valid
+
+ +
+
Valid
+
+ +
+
Valid 1
+
Valid 2
+
diff --git a/tests/microformats-v2-unit/names/names-properties-multi.json b/tests/microformats-v2-unit/names/names-properties-multi.json new file mode 100644 index 0000000..f4c23ce --- /dev/null +++ b/tests/microformats-v2-unit/names/names-properties-multi.json @@ -0,0 +1,49 @@ +{ + "items": [ + { + "type": [ + "h-1-test" + ], + "properties": { + "a": [ + "Valid" + ], + "b": [ + "Valid" + ] + } + }, + { + "type": [ + "h-2-test" + ], + "properties": { + "c": [ + "Valid" + ], + "d": [ + "Valid" + ], + "e": [ + "Valid" + ], + "f": [ + "Valid" + ] + } + }, + { + "type": [ + "h-3-test" + ], + "properties": { + "g": [ + "Valid 1", + "Valid 2" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/names/names-properties.html b/tests/microformats-v2-unit/names/names-properties.html new file mode 100644 index 0000000..376438e --- /dev/null +++ b/tests/microformats-v2-unit/names/names-properties.html @@ -0,0 +1,285 @@ +
+
NotPartOfTest
+ +
Valid
+
Valid
+
Valid
+
Valid
+
Valid
+ +
Valid
+
Valid
+
Valid
+
Valid
+
Valid
+
Valid
+ +
Valid
+
Valid
+
Valid
+
Valid
+
Valid
+ +
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+ +
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
+ +
+
NotPartOfTest
+ +
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+ +
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+ +
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+
2000-01-01 00:00:00+00:00
+ +
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+ +
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
1900-01-01 00:00:00+00:00
+
+ +
+
NotPartOfTest
+ +
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+ +
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+ +
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+ +
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+ +
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
+ +
+
NotPartOfTest
+ +
Valid
+
Valid
+
Valid
+
Valid
+
Valid
+ +
Valid
+
Valid
+
Valid
+
Valid
+
Valid
+
Valid
+ +
Valid
+
Valid
+
Valid
+
Valid
+
Valid
+ +
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+ +
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
+ + +
+
NotPartOfTest
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
Invalid
+
diff --git a/tests/microformats-v2-unit/names/names-properties.json b/tests/microformats-v2-unit/names/names-properties.json new file mode 100644 index 0000000..6e83570 --- /dev/null +++ b/tests/microformats-v2-unit/names/names-properties.json @@ -0,0 +1,296 @@ +{ + "items": [ + { + "type": [ + "h-test-p" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "t": [ + "Valid" + ], + "test": [ + "Valid" + ], + "test-three": [ + "Valid" + ], + "test-test-four": [ + "Valid" + ], + "test-five-t": [ + "Valid" + ], + "6-test": [ + "Valid" + ], + "7t-test": [ + "Valid" + ], + "8t8-test": [ + "Valid" + ], + "t9-test": [ + "Valid" + ], + "t10-test-test": [ + "Valid" + ], + "t11t-test-t": [ + "Valid" + ], + "t12-test": [ + "Valid" + ], + "t13-test": [ + "Valid" + ], + "t14-test": [ + "Valid" + ], + "t15-test": [ + "Valid" + ], + "t16-test": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-dt" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "t": [ + "2000-01-01 00:00:00+00:00" + ], + "test": [ + "2000-01-01 00:00:00+00:00" + ], + "test-three": [ + "2000-01-01 00:00:00+00:00" + ], + "test-test-four": [ + "2000-01-01 00:00:00+00:00" + ], + "test-five-t": [ + "2000-01-01 00:00:00+00:00" + ], + "6-test": [ + "2000-01-01 00:00:00+00:00" + ], + "7t-test": [ + "2000-01-01 00:00:00+00:00" + ], + "8t8-test": [ + "2000-01-01 00:00:00+00:00" + ], + "t9-test": [ + "2000-01-01 00:00:00+00:00" + ], + "t10-test-test": [ + "2000-01-01 00:00:00+00:00" + ], + "t11t-test-t": [ + "2000-01-01 00:00:00+00:00" + ], + "t12-test": [ + "2000-01-01 00:00:00+00:00" + ], + "t13-test": [ + "2000-01-01 00:00:00+00:00" + ], + "t14-test": [ + "2000-01-01 00:00:00+00:00" + ], + "t15-test": [ + "2000-01-01 00:00:00+00:00" + ], + "t16-test": [ + "2000-01-01 00:00:00+00:00" + ] + } + }, + { + "type": [ + "h-test-u" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "t": [ + "http://example.test/Valid" + ], + "test": [ + "http://example.test/Valid" + ], + "test-three": [ + "http://example.test/Valid" + ], + "test-test-four": [ + "http://example.test/Valid" + ], + "test-five-t": [ + "http://example.test/Valid" + ], + "6-test": [ + "http://example.test/Valid" + ], + "7t-test": [ + "http://example.test/Valid" + ], + "8t8-test": [ + "http://example.test/Valid" + ], + "t9-test": [ + "http://example.test/Valid" + ], + "t10-test-test": [ + "http://example.test/Valid" + ], + "t11t-test-t": [ + "http://example.test/Valid" + ], + "t12-test": [ + "http://example.test/Valid" + ], + "t13-test": [ + "http://example.test/Valid" + ], + "t14-test": [ + "http://example.test/Valid" + ], + "t15-test": [ + "http://example.test/Valid" + ], + "t16-test": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-e" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "t": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "test-three": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "test-test-four": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "test-five-t": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "6-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "7t-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "8t8-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "t9-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "t10-test-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "t11t-test-t": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "t12-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "t13-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "t14-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "t15-test": [ + { + "html": "Valid", + "value": "Valid" + } + ], + "t16-test": [ + { + "html": "Valid", + "value": "Valid" + } + ] + } + }, + { + "type": [ + "h-test-bogus" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/names/tentative-names-properties-multi.html b/tests/microformats-v2-unit/names/tentative-names-properties-multi.html new file mode 100644 index 0000000..14b99b0 --- /dev/null +++ b/tests/microformats-v2-unit/names/tentative-names-properties-multi.html @@ -0,0 +1,13 @@ + + +
+
Duplicated
+
+ +
+
2000-01-01 00:00:00+00:00
+
diff --git a/tests/microformats-v2-unit/names/tentative-names-properties-multi.json b/tests/microformats-v2-unit/names/tentative-names-properties-multi.json new file mode 100644 index 0000000..2d46cdc --- /dev/null +++ b/tests/microformats-v2-unit/names/tentative-names-properties-multi.json @@ -0,0 +1,28 @@ +{ + "items": [ + { + "type": [ + "h-1-test" + ], + "properties": { + "a": [ + "Duplicated", + "Duplicated" + ] + } + }, + { + "type": [ + "h-2-test" + ], + "properties": { + "b": [ + "2000-01-01 00:00:00+00:00", + "2000-01-01 00:00:00+00:00" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/nested/nested-microformat-mistyped.html b/tests/microformats-v2-unit/nested/nested-microformat-mistyped.html new file mode 100644 index 0000000..4fccdbd --- /dev/null +++ b/tests/microformats-v2-unit/nested/nested-microformat-mistyped.html @@ -0,0 +1,32 @@ + + +
+
NotPartOfTest
+
Valid
+
+
+
NotPartOfTest
+
Valid
+
+
+
NotPartOfTest
+
Valid
+
+ +
+
NotPartOfTest
+
Valid
+
+
+
NotPartOfTest
+
Valid
+
+
+
NotPartOfTest
+
Valid
+
diff --git a/tests/microformats-v2-unit/nested/nested-microformat-mistyped.json b/tests/microformats-v2-unit/nested/nested-microformat-mistyped.json new file mode 100644 index 0000000..b22620b --- /dev/null +++ b/tests/microformats-v2-unit/nested/nested-microformat-mistyped.json @@ -0,0 +1,153 @@ +{ + "items": [ + { + "type": [ + "h-test-as-p-with-u-name" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "http://example.test/l" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-p-with-dt-name" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "l" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-p-with-e-name" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + { + "html": "l", + "value": "l" + } + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-u-with-p-url" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "url": [ + "l" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-u-with-dt-url" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "url": [ + "l" + ], + "name": [ + "Valid" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-u-with-e-url" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "url": [ + { + "html": "l", + "value": "l" + } + ] + } + } + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/nested/nested-microformat.html b/tests/microformats-v2-unit/nested/nested-microformat.html new file mode 100644 index 0000000..3e722a4 --- /dev/null +++ b/tests/microformats-v2-unit/nested/nested-microformat.html @@ -0,0 +1,63 @@ + + +
+
NotPartOfTest
+
+
NotPartOfTest
+
+
+
NotPartOfTest
+
+
NotPartOfTest
+
+
+ + +
+
NotPartOfTest
+
Valid
+
+
+
NotPartOfTest
+
+ Invalid Valid Invalid +
+
+ +
+
NotPartOfTest
+
Valid
+
+
+
NotPartOfTest
+
+ Invalid Valid Invalid +
+
+ +
+
NotPartOfTest
+
Valid
+
+ +
+
NotPartOfTest
+
+
Valid
+
http://example.test/Valid
+
+
diff --git a/tests/microformats-v2-unit/nested/nested-microformat.json b/tests/microformats-v2-unit/nested/nested-microformat.json new file mode 100644 index 0000000..633b1aa --- /dev/null +++ b/tests/microformats-v2-unit/nested/nested-microformat.json @@ -0,0 +1,219 @@ +{ + "items": [ + { + "type": [ + "h-test-as-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + }, + "children": [ + { + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-as-child-multi" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + }, + "children": [ + { + "type": [ + "h-test-a", + "h-test-b" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-as-p" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "not-part-of-test": [ + "l" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-p-with-name" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "Valid" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-u" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "http://example.test/Valid", + "type": [ + "h-test-a" + ], + "properties": { + "not-part-of-test": [ + "http://example.test/l" + ], + "name": [ + "Valid" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-u-with-url" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "http://example.test/Valid", + "type": [ + "h-test-a" + ], + "properties": { + "url": [ + "http://example.test/Valid" + ], + "name": [ + "Valid" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-dt" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "not-part-of-test": [ + "l" + ], + "name": [ + "Valid" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-multi" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "a": [ + { + "value": "Valid", + "type": [ + "h-test-a", + "h-test-b" + ], + "properties": { + "name": [ + "Valid" + ], + "url": [ + "http://example.test/Valid" + ] + } + } + ], + "b": [ + { + "value": "http://example.test/Valid", + "type": [ + "h-test-a", + "h-test-b" + ], + "properties": { + "name": [ + "Valid" + ], + "url": [ + "http://example.test/Valid" + ] + } + } + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/nested/tentative-nested-microformat.html b/tests/microformats-v2-unit/nested/tentative-nested-microformat.html new file mode 100644 index 0000000..f744785 --- /dev/null +++ b/tests/microformats-v2-unit/nested/tentative-nested-microformat.html @@ -0,0 +1,42 @@ + + + +
+
NotPartOfTest
+
Valid
+
+ +
+
NotPartOfTest
+
+
NotPartOfTest
+ Valid +
+
+ + +
+
+ Invalid + Invalid + Invalid +
+
+
+
NotPartOfTest
+
+ Invalid + NotPartOfTest + Invalid +
+
diff --git a/tests/microformats-v2-unit/nested/tentative-nested-microformat.json b/tests/microformats-v2-unit/nested/tentative-nested-microformat.json new file mode 100644 index 0000000..488fc86 --- /dev/null +++ b/tests/microformats-v2-unit/nested/tentative-nested-microformat.json @@ -0,0 +1,108 @@ +{ + "items": [ + { + "type": [ + "h-test-as-e" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "html": "
Valid
", + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "Valid" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-as-u-with-img" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "test": [ + { + "value": { + "value": "http://example.test/Valid", + "alt": "Valid" + }, + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "url": [ + { + "value": "http://example.test/Valid", + "alt": "Valid" + } + ] + } + } + ] + } + }, + { + "type": [ + "h-test-implied-name" + ], + "properties": { + "name": [ + { + "value": "Valid", + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "Valid" + ] + } + } + ] + } + }, + { + "type": [ + "h-test-implied-url" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "url": [ + { + "value": "http://example.test/Valid", + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "url": [ + "http://example.test/Valid" + ] + } + } + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/properties/properties-dt.html b/tests/microformats-v2-unit/properties/properties-dt.html new file mode 100644 index 0000000..0b1d3b9 --- /dev/null +++ b/tests/microformats-v2-unit/properties/properties-dt.html @@ -0,0 +1,58 @@ + + +
+
http://example.test/NotPartOfTest
+ + + + +
+ +
+
http://example.test/NotPartOfTest
+ Valid + Invalid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+ Valid + Invalid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+ Valid + Invalid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+ Valid + Invalid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+
Valid
+
Valid
+
Valid
+
Valid
+
diff --git a/tests/microformats-v2-unit/properties/properties-dt.json b/tests/microformats-v2-unit/properties/properties-dt.json new file mode 100644 index 0000000..8c3deaf --- /dev/null +++ b/tests/microformats-v2-unit/properties/properties-dt.json @@ -0,0 +1,174 @@ +{ + "items": [ + { + "type": [ + "h-test-time" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "datetime-missing": [ + "Valid" + ], + "datetime-empty": [ + "" + ], + "datetime-filled": [ + "Valid" + ], + "datetime-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-ins" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "datetime-missing": [ + "Valid" + ], + "datetime-empty": [ + "" + ], + "datetime-filled": [ + "Valid" + ], + "datetime-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-del" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "datetime-missing": [ + "Valid" + ], + "datetime-empty": [ + "" + ], + "datetime-filled": [ + "Valid" + ], + "datetime-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-abbr" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "title-missing": [ + "Valid" + ], + "title-empty": [ + "" + ], + "title-filled": [ + "Valid" + ], + "title-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-data" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "value-missing": [ + "Valid" + ], + "value-empty": [ + "" + ], + "value-filled": [ + "Valid" + ], + "value-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-else" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "anything-else": [ + "Valid" + ], + "meaningless-datetime": [ + "Valid" + ], + "meaningless-title": [ + "Valid" + ], + "meaningless-value": [ + "Valid" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/properties/properties-e.html b/tests/microformats-v2-unit/properties/properties-e.html new file mode 100644 index 0000000..7a52a7b --- /dev/null +++ b/tests/microformats-v2-unit/properties/properties-e.html @@ -0,0 +1,11 @@ + + +
+
http://example.test/NotPartOfTest
+
Valid
+
diff --git a/tests/microformats-v2-unit/properties/properties-e.json b/tests/microformats-v2-unit/properties/properties-e.json new file mode 100644 index 0000000..a11a89e --- /dev/null +++ b/tests/microformats-v2-unit/properties/properties-e.json @@ -0,0 +1,28 @@ +{ + "items": [ + { + "type": [ + "h-test" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "test": [ + { + "html": "Valid", + "value": "Valid" + } + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/properties/properties-p.html b/tests/microformats-v2-unit/properties/properties-p.html new file mode 100644 index 0000000..16f3984 --- /dev/null +++ b/tests/microformats-v2-unit/properties/properties-p.html @@ -0,0 +1,66 @@ + + +
+
http://example.test/NotPartOfTest
+ Valid + Invalid + Invalid + Invalid +
+ + + +
+
http://example.test/NotPartOfTest
+ Valid + Invalid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+ + + + +
+ +
+
http://example.test/NotPartOfTest
+ + + Valid +  No Trim +
+ +
+
http://example.test/NotPartOfTest
+ + + Valid +  No Trim +
+ +
+
http://example.test/NotPartOfTest
+
Valid
+
Valid
+
Valid
+
Valid
+
diff --git a/tests/microformats-v2-unit/properties/properties-p.json b/tests/microformats-v2-unit/properties/properties-p.json new file mode 100644 index 0000000..7313fac --- /dev/null +++ b/tests/microformats-v2-unit/properties/properties-p.json @@ -0,0 +1,202 @@ +{ + "items": [ + { + "type": [ + "h-test-abbr" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "title-missing": [ + "Valid" + ], + "title-empty": [ + "" + ], + "title-filled": [ + "Valid" + ], + "title-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-link" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "title-missing": [ + "" + ], + "title-empty": [ + "" + ], + "title-filled": [ + "Valid" + ], + "title-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-data" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "value-missing": [ + "Valid" + ], + "value-empty": [ + "" + ], + "value-filled": [ + "Valid" + ], + "value-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-input" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "value-missing": [ + "" + ], + "value-empty": [ + "" + ], + "value-filled": [ + "Valid" + ], + "value-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-img" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "alt-missing": [ + "" + ], + "alt-empty": [ + "" + ], + "alt-filled": [ + "Valid" + ], + "alt-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-area" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "alt-missing": [ + "" + ], + "alt-empty": [ + "" + ], + "alt-filled": [ + "Valid" + ], + "alt-filled-space": [ + " No Trim " + ] + } + }, + { + "type": [ + "h-test-else" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "anything-else": [ + "Valid" + ], + "meaningless-title": [ + "Valid" + ], + "meaningless-value": [ + "Valid" + ], + "meaningless-alt": [ + "Valid" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/properties/properties-u.html b/tests/microformats-v2-unit/properties/properties-u.html new file mode 100644 index 0000000..b42f982 --- /dev/null +++ b/tests/microformats-v2-unit/properties/properties-u.html @@ -0,0 +1,124 @@ + + +
+
http://example.test/NotPartOfTest
+ http://example.test/Valid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+ + + +
+ + + +
+
http://example.test/NotPartOfTest
+ + + Invalid +  Invalid + + + Valid +  No Trim + + + Valid +  No Trim +
+ +
+
http://example.test/NotPartOfTest
+ + + +
+ +
+
http://example.test/NotPartOfTest
+ + + +
+ +
+
http://example.test/NotPartOfTest
+ + + +
+ +
+
http://example.test/NotPartOfTest
+ + + + + + + +
+ +
+
http://example.test/NotPartOfTest
+ http://example.test/Valid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+ http://example.test/Valid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+ http://example.test/Valid + Invalid + Invalid +
+ +
+
http://example.test/NotPartOfTest
+ + + +
+ +
+
http://example.test/NotPartOfTest
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
http://example.test/Valid
+
diff --git a/tests/microformats-v2-unit/properties/properties-u.json b/tests/microformats-v2-unit/properties/properties-u.json new file mode 100644 index 0000000..765e1ff --- /dev/null +++ b/tests/microformats-v2-unit/properties/properties-u.json @@ -0,0 +1,401 @@ +{ + "items": [ + { + "type": [ + "h-test-a" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "href-missing": [ + "http://example.test/Valid" + ], + "href-empty": [ + "http://example.test" + ], + "href-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-area" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "href-missing": [ + "http://example.test" + ], + "href-empty": [ + "http://example.test" + ], + "href-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-link" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "href-missing": [ + "http://example.test" + ], + "href-empty": [ + "http://example.test" + ], + "href-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-img" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "src-missing-alt-missing": [ + "http://example.test" + ], + "src-missing-alt-empty": [ + "http://example.test" + ], + "src-missing-alt-filled": [ + "http://example.test" + ], + "src-missing-alt-filled-space": [ + "http://example.test" + ], + "src-empty-alt-missing": [ + "http://example.test" + ], + "src-empty-alt-empty": [ + { + "value": "http://example.test", + "alt": "" + } + ], + "src-empty-alt-filled": [ + { + "value": "http://example.test", + "alt": "Valid" + } + ], + "src-empty-alt-filled-space": [ + { + "value": "http://example.test", + "alt": " No Trim " + } + ], + "src-filled-alt-missing": [ + "http://example.test/Valid" + ], + "src-filled-alt-empty": [ + { + "value": "http://example.test/Valid", + "alt": "" + } + ], + "src-filled-alt-filled": [ + { + "value": "http://example.test/Valid", + "alt": "Valid" + } + ], + "src-filled-alt-filled-space": [ + { + "value": "http://example.test/Valid", + "alt": " No Trim " + } + ] + } + }, + { + "type": [ + "h-test-audio" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "src-missing": [ + "http://example.test/Valid" + ], + "src-empty": [ + "http://example.test" + ], + "src-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-iframe" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "src-missing": [ + "http://example.test/Valid" + ], + "src-empty": [ + "http://example.test" + ], + "src-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-source" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "src-missing": [ + "http://example.test" + ], + "src-empty": [ + "http://example.test" + ], + "src-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-video" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "src-and-poster-missing": [ + "http://example.test/Valid" + ], + "src-empty": [ + "http://example.test" + ], + "src-filled": [ + "http://example.test/Valid" + ], + "poster-empty": [ + "http://example.test" + ], + "poster-filled": [ + "http://example.test/Valid" + ], + "src-trumps-poster": [ + "http://example.test/Valid", + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-object" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "data-missing": [ + "http://example.test/Valid" + ], + "data-empty": [ + "http://example.test" + ], + "data-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-abbr" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "title-missing": [ + "http://example.test/Valid" + ], + "title-empty": [ + "http://example.test" + ], + "title-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-data" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "value-missing": [ + "http://example.test/Valid" + ], + "value-empty": [ + "http://example.test" + ], + "value-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-input" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "value-missing": [ + "http://example.test" + ], + "value-empty": [ + "http://example.test" + ], + "value-filled": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-else" + ], + "properties": { + "name": [ + "http://example.test/NotPartOfTest" + ], + "photo": [ + "http://example.test/NotPartOfTest" + ], + "url": [ + "http://example.test/NotPartOfTest" + ], + "anything-else": [ + "http://example.test/Valid" + ], + "meaningless-title": [ + "http://example.test/Valid" + ], + "meaningless-value": [ + "http://example.test/Valid" + ], + "meaningless-alt": [ + "http://example.test/Valid" + ], + "meaningless-href": [ + "http://example.test/Valid" + ], + "meaningless-src": [ + "http://example.test/Valid" + ], + "meaningless-data": [ + "http://example.test/Valid" + ], + "meaningless-poster": [ + "http://example.test/Valid" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/value/value-dt.html b/tests/microformats-v2-unit/value/value-dt.html new file mode 100644 index 0000000..d825402 --- /dev/null +++ b/tests/microformats-v2-unit/value/value-dt.html @@ -0,0 +1,123 @@ + + +
+
NotPartOfTest
+
Invalid 2000-01-01 Invalid
+
Invalid 2000-01-01 Invalid 00:00:00
+
Invalid 2000-01-01 Invalid
+
Invalid 2000-01-01 Invalid Invalid 00:00:00 Invalid Invalid Invalid
+
Invalid
2000-01-01
Invalid
+
Invalid
2000-01-01
Invalid
+
+ Invalid + 2000-01-01 +
23:59:59
+ Invalid +
+ +
+ Invalid + 2000-01-01 +
23:59:59
+ Invalid +
+
+ +
+
NotPartOfTest
+
Valid NotADate Valid
+
Invalid 2000-01-01 00:00:00+00:00 Invalid
+
Invalid 2000-01-0100:00:00+00:00 Invalid
+
+ Invalid + 2000-01-01 + 1999-12-31 + Invalid +
+
+ Invalid + 00:00:00 + 2099-12-31 23:59:59 + 2000-01-01 + Invalid +
+
+ Invalid + 2000-01-01 + 00:00:00 + 00:00:00+00:00 + Invalid +
+
+ +
+
NotPartOfTest
+
Invalid 2000-01-01 Invalid
+
Valid
+
Valid
+
+ +
+
NotPartOfTest
+
Invalid 2000-01-01 Invalid
+
Valid
+
Valid
+
+ +
+
NotPartOfTest
+
Invalid Invalid Invalid
+
Valid
+
Invalid 2000-01-01 Invalid
+
+ +
+
NotPartOfTest
+
Invalid Invalid Invalid
+
Valid
+
Invalid 2000-01-01 Invalid
+
+ + +
+
NotPartOfTest
+
Invalid Invalid
+
Vaid
+
Invalid Invalid
+
+ +
+
NotPartOfTest
+
Invalid Invalid Invalid
+
Valid
+
Invalid 2000-01-01 Invalid
+
+ +
+
NotPartOfTest
+
Invalid Invalid Invalid
+
Valid
+
Invalid 2000-01-01 Invalid
+
+ + +
+
NotPartOfTest
+ + Invalid 2000-01-01 Invalid + Invalid 2000-01-01 Invalid + Invalid 2000-01-01 Invalid + Invalid 2000-01-01 Invalid +
diff --git a/tests/microformats-v2-unit/value/value-dt.json b/tests/microformats-v2-unit/value/value-dt.json new file mode 100644 index 0000000..12e393b --- /dev/null +++ b/tests/microformats-v2-unit/value/value-dt.json @@ -0,0 +1,252 @@ +{ + "items": [ + { + "type": [ + "h-test-value" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "single": [ + "2000-01-01" + ], + "double": [ + "2000-01-01 00:00:00" + ], + "other-classes": [ + "2000-01-01" + ], + "deep": [ + "2000-01-01 00:00:00" + ], + "is-property": [ + "2000-01-01" + ], + "not-part-of-test": [ + "2000-01-01", + "23:59:59" + ], + "is-microformat": [ + "2000-01-01" + ], + "inside-property": [ + "2000-01-01" + ], + "inside-microformat": [ + "2000-01-01" + ] + }, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "2000-01-01" + ] + } + }, + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "23:59:59" + ] + } + } + ] + }, + { + "type": [ + "h-test-acceptable" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "not-a-date": [ + "Valid NotADate Valid" + ], + "1-with-tz": [ + "2000-01-01 00:00:00+00:00" + ], + "2-with-tz": [ + "2000-01-01 00:00:00+00:00" + ], + "1-first-wins": [ + "2000-01-01" + ], + "2-first-wins": [ + "2000-01-01 00:00:00" + ], + "3-first-wins": [ + "2000-01-01 00:00:00" + ] + } + }, + { + "type": [ + "h-test-img" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "2000-01-01" + ], + "empty": [ + "Valid" + ], + "missing": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-area" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "2000-01-01" + ], + "empty": [ + "Valid" + ], + "missing": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-data" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "2000-01-01" + ], + "empty": [ + "Valid" + ], + "missing": [ + "2000-01-01" + ] + } + }, + { + "type": [ + "h-test-abbr" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "2000-01-01" + ], + "empty": [ + "Valid" + ], + "missing": [ + "2000-01-01" + ] + } + }, + { + "type": [ + "h-test-time" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "2000-01-01" + ], + "empty": [ + "Valid" + ], + "missing": [ + "2000-01-01" + ] + } + }, + { + "type": [ + "h-test-ins" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "2000-01-01" + ], + "empty": [ + "Valid" + ], + "missing": [ + "2000-01-01" + ] + } + }, + { + "type": [ + "h-test-del" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "2000-01-01" + ], + "empty": [ + "Valid" + ], + "missing": [ + "2000-01-01" + ] + } + }, + { + "type": [ + "h-test-override" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "time": [ + "2000-01-01" + ], + "ins": [ + "2000-01-01" + ], + "del": [ + "2000-01-01" + ], + "abbr": [ + "2000-01-01" + ], + "data": [ + "2000-01-01" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/value/value-e.html b/tests/microformats-v2-unit/value/value-e.html new file mode 100644 index 0000000..58ac7ff --- /dev/null +++ b/tests/microformats-v2-unit/value/value-e.html @@ -0,0 +1,15 @@ + + +
+
NotPartOfTest
+
Valid
+
diff --git a/tests/microformats-v2-unit/value/value-e.json b/tests/microformats-v2-unit/value/value-e.json new file mode 100644 index 0000000..4dcade4 --- /dev/null +++ b/tests/microformats-v2-unit/value/value-e.json @@ -0,0 +1,22 @@ +{ + "items": [ + { + "type": [ + "h-test-no-vcp" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "no-vcp": [ + { + "html": "Valid", + "value": "Valid" + } + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/value/value-p.html b/tests/microformats-v2-unit/value/value-p.html new file mode 100644 index 0000000..4bce5af --- /dev/null +++ b/tests/microformats-v2-unit/value/value-p.html @@ -0,0 +1,87 @@ + + +
+
Invalid Valid Invalid
+
Invalid Va Invalid lid
+
Invalid V a l i d Invalid
+
Invalid Valid Invalid
+
Invalid Valid Invalid
+
Invalid Valid Invalid
+
Invalid Va Invalid Invalid lid Invalid Invalid Invalid
+
Invalid
Valid
Invalid
+
Invalid
Valid
Invalid
+
+ Invalid + Valid +
NotPartOfTest
+ Invalid +
+ +
+ Invalid + Valid +
NotPartOfTest
+ Invalid +
+
+ +
+
Invalid Valid Invalid
+
Invalid  No Trim Invalid
+
Invalid Invalid
+
Invalid Invalid
+
+ +
+
Invalid Valid Invalid
+
Invalid  No Trim Invalid
+
Invalid Invalid
+
Invalid Invalid
+
+ +
+
Invalid Invalid Invalid
+
Invalid Invalid Invalid
+
Invalid Invalid Invalid
+
Invalid Valid Invalid
+
+ +
+
Invalid Invalid Invalid
+
Invalid Invalid Invalid
+
Invalid Invalid Invalid
+
Invalid Valid Invalid
+
+ + +
+
NotPartOfTest
+
Invalid Invalid
+
Invalid Invalid
+
Invalid Invalid
+
+ +
+
NotPartOfTest
+
Invalid Valid Invalid
+
Invalid Valid Invalid
+
Invalid Valid Invalid
+
+ +
+
NotPartOfTest
+
Invalid Valid Invalid
+
Invalid Valid Invalid
+
Invalid Valid Invalid
+
+ + +
+ Invalid Valid Invalid + Invalid Valid Invalid +
diff --git a/tests/microformats-v2-unit/value/value-p.json b/tests/microformats-v2-unit/value/value-p.json new file mode 100644 index 0000000..57c127b --- /dev/null +++ b/tests/microformats-v2-unit/value/value-p.json @@ -0,0 +1,218 @@ +{ + "items": [ + { + "type": [ + "h-test-value" + ], + "properties": { + "single": [ + "Valid" + ], + "double": [ + "Valid" + ], + "quintuple": [ + "Valid" + ], + "nested": [ + "Valid" + ], + "other-classes": [ + "Valid" + ], + "self": [ + "Valid" + ], + "deep": [ + "Valid" + ], + "is-property": [ + "Valid" + ], + "not-part-of-test": [ + "Valid", + "NotPartOfTest" + ], + "is-microformat": [ + "Valid" + ], + "inside-property": [ + "Valid" + ], + "inside-microformat": [ + "Valid" + ] + }, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-img" + ], + "properties": { + "filled": [ + "Valid" + ], + "filled-space": [ + " No Trim " + ], + "empty": [ + "" + ], + "missing": [ + "" + ] + } + }, + { + "type": [ + "h-test-area" + ], + "properties": { + "filled": [ + "Valid" + ], + "filled-space": [ + " No Trim " + ], + "empty": [ + "" + ], + "missing": [ + "" + ] + } + }, + { + "type": [ + "h-test-data" + ], + "properties": { + "filled": [ + "Valid" + ], + "filled-space": [ + " No Trim " + ], + "empty": [ + "" + ], + "missing": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-abbr" + ], + "properties": { + "filled": [ + "Valid" + ], + "filled-space": [ + " No Trim " + ], + "empty": [ + "" + ], + "missing": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-time" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "Valid" + ], + "empty": [ + "Valid" + ], + "missing": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-ins" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "Valid" + ], + "empty": [ + "Valid" + ], + "missing": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-del" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "Valid" + ], + "empty": [ + "Valid" + ], + "missing": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-override" + ], + "properties": { + "abbr": [ + "Valid" + ], + "data": [ + "Valid" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +} diff --git a/tests/microformats-v2-unit/value/value-u.html b/tests/microformats-v2-unit/value/value-u.html new file mode 100644 index 0000000..411a5b6 --- /dev/null +++ b/tests/microformats-v2-unit/value/value-u.html @@ -0,0 +1,99 @@ + + +
+
NotPartOfTest
+
Invalid http://example.test/Valid Invalid
+
Invalid http://example.test/Va Invalid lid
+
Invalid http://example.test/V a l i d Invalid
+
Invalid http://example.test/Valid Invalid
+
Invalid http://example.test/Valid Invalid
+
Invalid http://example.test/Valid Invalid
+
Invalid http://example.test/Va Invalid Invalid lid Invalid Invalid Invalid
+
Invalid
http://example.test/Valid
Invalid
+
Invalid
Valid
Invalid
+
+ Invalid + http://example.test/Valid +
NotPartOfTest
+ Invalid +
+ +
+ Invalid + http://example.test/Valid +
NotPartOfTest
+ Invalid +
+
+ +
+
NotPartOfTest
+
Invalid http://example.test/Valid Invalid
+
Invalid Invalid
+
Invalid Invalid
+
+ +
+
NotPartOfTest
+
Invalid http://example.test/Valid Invalid
+
Invalid Invalid
+
Invalid Invalid
+
+ +
+
NotPartOfTest
+
Invalid Invalid Invalid
+
Invalid Invalid Invalid
+
Invalid http://example.test/Valid Invalid
+
+ +
+
NotPartOfTest
+
Invalid Invalid Invalid
+
Invalid Invalid Invalid
+
Invalid http://example.test/Valid Invalid
+
+ + +
+
NotPartOfTest
+
Invalid Invalid
+
Invalid Invalid
+
Invalid Invalid
+
+ +
+
NotPartOfTest
+
Invalid http://example.test/Valid Invalid
+
Invalid http://example.test/Valid Invalid
+
Invalid http://example.test/Valid Invalid
+
+ +
+
NotPartOfTest
+
Invalid http://example.test/Valid Invalid
+
Invalid http://example.test/Valid Invalid
+
Invalid http://example.test/Valid Invalid
+
+ + +
+
NotPartOfTest
+ + + + + Invalid + Invalid http://example.test/Valid Invalid + Invalid http://example.test/Valid Invalid +
diff --git a/tests/microformats-v2-unit/value/value-u.json b/tests/microformats-v2-unit/value/value-u.json new file mode 100644 index 0000000..d11b21d --- /dev/null +++ b/tests/microformats-v2-unit/value/value-u.json @@ -0,0 +1,239 @@ +{ + "items": [ + { + "type": [ + "h-test-value" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "single": [ + "http://example.test/Valid" + ], + "double": [ + "http://example.test/Valid" + ], + "quintuple": [ + "http://example.test/Valid" + ], + "nested": [ + "http://example.test/Valid" + ], + "other-classes": [ + "http://example.test/Valid" + ], + "self": [ + "http://example.test/Valid" + ], + "deep": [ + "http://example.test/Valid" + ], + "is-property": [ + "http://example.test/Valid" + ], + "not-part-of-test": [ + "http://example.test/Valid", + "NotPartOfTest" + ], + "is-microformat": [ + "http://example.test/Valid" + ], + "inside-property": [ + "http://example.test/Valid" + ], + "inside-microformat": [ + "http://example.test/Valid" + ] + }, + "children": [ + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "Valid" + ] + } + }, + { + "type": [ + "h-test-child" + ], + "properties": { + "name": [ + "NotPartOfTest" + ] + } + } + ] + }, + { + "type": [ + "h-test-img" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "http://example.test/Valid" + ], + "empty": [ + "http://example.test" + ], + "missing": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-area" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "http://example.test/Valid" + ], + "empty": [ + "http://example.test" + ], + "missing": [ + "http://example.test" + ] + } + }, + { + "type": [ + "h-test-data" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "http://example.test/Valid" + ], + "empty": [ + "http://example.test" + ], + "missing": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-abbr" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "http://example.test/Valid" + ], + "empty": [ + "http://example.test" + ], + "missing": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-time" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "http://example.test/Valid" + ], + "empty": [ + "http://example.test/Valid" + ], + "missing": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-ins" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "http://example.test/Valid" + ], + "empty": [ + "http://example.test/Valid" + ], + "missing": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-del" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "filled": [ + "http://example.test/Valid" + ], + "empty": [ + "http://example.test/Valid" + ], + "missing": [ + "http://example.test/Valid" + ] + } + }, + { + "type": [ + "h-test-override" + ], + "properties": { + "name": [ + "NotPartOfTest" + ], + "audio": [ + "http://example.test/Valid" + ], + "iframe": [ + "http://example.test/Valid" + ], + "video-src": [ + "http://example.test/Valid" + ], + "video-poster": [ + "http://example.test/Valid" + ], + "object": [ + "http://example.test/Valid" + ], + "abbr": [ + "http://example.test/Valid" + ], + "data": [ + "http://example.test/Valid" + ] + } + } + ], + "rels": {}, + "rel-urls": {} +}