Skip to content

Commit 0faad8a

Browse files
committed
fix test_emit for XML Parser change in java9
1 parent 28ee2cd commit 0faad8a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/test/clojure/clojure/data/xml/test_emit.clj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@
153153
(deftest test-indent-str-with-doctype
154154
(let [nested-xml (lazy-parse* (str "<a><b><c><d>foo</d></c></b></a>"))
155155
doctype "<!DOCTYPE html>"
156-
expect (str doctype "\n<a>\n <b>\n <c>\n <d>foo</d>\n </c>\n </b>\n</a>\n")
157-
result (indent-str nested-xml :doctype doctype)]
158-
(is (= expect (subs result (.indexOf result doctype))))))
156+
expect "\n<a>\n <b>\n <c>\n <d>foo</d>\n </c>\n </b>\n</a>\n"
157+
result (indent-str nested-xml :doctype doctype)
158+
offset-dt (.indexOf result "<!DOCTYPE")
159+
offset-res (inc (.indexOf result ">" offset-dt))]
160+
(is (= expect (subs result offset-res)))))
159161

160162
(defmacro are-serializable [group-description extra-attrs & {:as data-strings}]
161163
`(testing ~group-description

0 commit comments

Comments
 (0)