about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorAlan Pearce2014-09-13 10:00:49 +0100
committerAlan Pearce2014-09-13 10:01:42 +0100
commite8a96393c8e6c2b5f94e43e58680ee90a2b5a6b0 (patch)
treeff0973aa59bf040b6e2dde48acd33b960f3e0294 /test
parent1ebede4bbab4fc1315cc0bf5fdc402a29eab34e1 (diff)
downloadmicroformats-e8a96393c8e6c2b5f94e43e58680ee90a2b5a6b0.tar.lz
microformats-e8a96393c8e6c2b5f94e43e58680ee90a2b5a6b0.tar.zst
microformats-e8a96393c8e6c2b5f94e43e58680ee90a2b5a6b0.zip
Add basic support for dt-* parsing
Diffstat (limited to 'test')
-rw-r--r--test/microformats/parser_test.clj30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/microformats/parser_test.clj b/test/microformats/parser_test.clj
index 0f712de..63c7708 100644
--- a/test/microformats/parser_test.clj
+++ b/test/microformats/parser_test.clj
@@ -70,3 +70,33 @@
 
          {:photo "http://example.com/someimage.png"}
          "<data class=\"u-photo\">http://example.com/someimage.png</data>")))
+
+(deftest parse-dt-elements
+  (testing "Tags with dt-* classes should have their values parsed"
+    (are [ex in] (= ex (parse-dt (first (html-snippet in))))
+         {:start "2012-08-05T14:50"}
+         "<time class=\"dt-start\" datetime=\"2012-08-05T14:50\"></time>"
+
+         {:start "2012-08-05T14:50"}
+         "<time class=\"dt-start\">2012-08-05T14:50</time>"
+
+         {:start "2012-08-05T14:50"}
+         "<ins class=\"dt-start\" datetime=\"2012-08-05T14:50\"></ins>"
+
+         {:end "2012-08-05T18:00"}
+         "<del class=\"dt-end\" datetime=\"2012-08-05T18:00\"></del>"
+
+         {:start "2012-08-05T14:50"}
+         "<abbr class=\"dt-start\" title=\"2012-08-05T14:50\"></abbr>"
+
+         {:start "2012-08-05T14:50"}
+         "<abbr class=\"dt-start\">2012-08-05T14:50</abbr>"
+
+         {:start "2012-08-05T14:50"}
+         "<data class=\"dt-start\" value=\"2012-08-05T14:50\"></data>"
+
+         {:start "2012-08-05T14:50"}
+         "<data class=\"dt-start\">2012-08-05T14:50</data>"
+
+         {:start "2012-08-05T14:50"}
+         "<input class=\"dt-start\" value=\"2012-08-05T14:50\">")))