File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/test/clojure/clojure/data/xml Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ ; Copyright (c) Rich Hickey. All rights reserved.
2+ ; The use and distribution terms for this software are covered by the
3+ ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
4+ ; which can be found in the file epl-v10.html at the root of this distribution.
5+ ; By using this software in any fashion, you are agreeing to be bound by
6+ ; the terms of this license.
7+ ; You must not remove this notice, or any other, from this software.
8+
9+ (ns ^{:doc " Tests for event seqs." }
10+ clojure.data.xml.test-event
11+ (:require [clojure.test :refer :all ]
12+ [clojure.data.xml :refer :all ]
13+ [clojure.data.xml.event :as event])
14+ (:import
15+ [java.io StringReader]
16+ [clojure.data.xml.event StartElementEvent CharsEvent EndElementEvent]))
17+
18+ (deftest test-end-element-info
19+ (let [ev (vec (event-seq (StringReader. " <a><b>123</b></a>" ) {}))]
20+ (is (= 5 (count ev)))
21+ (is (= [StartElementEvent StartElementEvent CharsEvent EndElementEvent EndElementEvent]
22+ (map type ev)))
23+ (let [ee (last ev)]
24+ (is (= :a (:tag ee)))
25+ (is (= {:line-number 1 , :column-number 14 , :character-offset 13 } (:location-info ee))))))
26+
27+ (comment
28+ (run-tests )
29+ )
You can’t perform that action at this time.
0 commit comments