Add tests borrowed from Hiccup's test suite and make small tweaks to match Hiccup/Reagent behavior.
So far, the only divergence that has a semantic difference is our handling of conflicts between attributes in the map and tag. I think we want to follow Reagent's handling, but I don't know what that is yet.
- [x] Verify it's okay to use Eclipse-licensed code in a project using the Mozilla Public License. I think these licenses are effectively identical, but IMO, it's worth double checking.
- [x] Divide failing tests into two buckets: skip and write up and issue (because we'll fix later) and amend and document (because we like how our behavior diverges).
- [x] Figure out how Reagent handles the conflicting scenario.
Based on looking into it further, MPL and EPL are very similar and as far as I can tell, can be combined freely.
Latest version of Reagent's test suite: https://github.com/reagent-project/reagent/blob/master/src/reagent/impl/template.cljs. While I'm just integrating Hiccup tests for now, I'm trying to avoid introducing any incompatibilities.
I think we can merge this after #5.
I believe that #7 would have been caught by these tests.
Caught more issues introduced (I'm pretty sure) by #5:
- If the class is specified in the initial keyword and the attribute map (e.g.,
[:div.foo {:class "bar"} "baz"]), it's now rendering twice, as"<div id="baq" id="bar" class="foo">baz</div>" - ~~Fragments don't seem to work anymore. E.g.,
[:div [test-fragment-component "hello"]]gets rendered as"<div><<>nn><p>hello</p><p>hello</p></<>nn></div>"~~
The latter might be due to the interaction between #5 and this PR since I think the fragment test existed prior to this PR.
Never mind, that second issue was caused by a typo I introduced during rebase.