diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/microformats/parser_expectations.clj | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/microformats/parser_expectations.clj b/test/microformats/parser_expectations.clj index 6ce942e..92e4448 100644 --- a/test/microformats/parser_expectations.clj +++ b/test/microformats/parser_expectations.clj @@ -157,6 +157,11 @@ (expect {:author '("http://example.com/a")} (parse-rels (snippets "<a rel=\"author\" href=\"http://example.com/a\">author a</a>"))) +(expect {:author '("http://example.com/a")} + (parse-rels (snippets " +<html><head><base href=\"http://example.com\"><body> +<a rel=\"author\" href=\"/a\">author a</a>"))) + (expect {:author '("http://example.com/a" "http://example.com/b")} (parse-rels (snippets "<a rel=\"author\" href=\"http://example.com/a\">author a</a> <a rel=\"author\" href=\"http://example.com/b\">author b</a>"))) @@ -276,3 +281,23 @@ <span class=\"p-name\">John Doe</span> <span class=\"p-org h-card h-org\">Example</span> </div>")) + +(expect {:items '({:type ("h-card") :properties {:name ("Example User") :url ("http://example.com/")}}) :rels {}} + (parse "<html><head><base href=\"http://example.com\"></head><body> +<div class=\"h-card\"><a class=\"u-url\" href=\"/\">Example User</a></div></body></html>")) + +(expect {:items '({:type ("h-card") :properties {:name ("Example User") :url ("http://example.com/")}}) :rels {}} + (parse "<html><head><base href=\"http://example.com\"></head><body> +<div class=\"h-card\"><a href=\"/\">Example User</a></div></body></html>")) + +(expect {:items '({:type ("h-card") :properties {:name ("Example User") + :photo ("http://example.com/me.png")}}) :rels {}} + (parse "<html><head><base href=\"http://example.com/\"></head><body> +<div class=\"h-card\"><img alt=\"Example User\" src=\"me.png\"></div> +</body></html>")) + +(expect {:items '({:type ("h-card") :properties {:name ("Example User") + :photo ("http://example.com/me.png")}}) :rels {}} + (parse "<html><head><base href=\"http://example.com/\"></head><body> +<div class=\"h-card\"><img class=\"u-photo\" alt=\"Example User\" src=\"me.png\"></div> +</body></html>")) |