on master help sign in
Add a test of location
commit4a2f2abb05599960851a8ca8aadb94535613f4b5 authorNeil Mitchell <ndmitchell@gmail.com> dateWed 30 Nov 2016, 19:08 (10 years ago) parent7df2ee9
1 file changed+2−1
src/Main.hs+2−1
src/Main.hs+2−1
@@ -33,8 +33,9 @@ main = do
3333 let Right d = parse r
3434 r === render d
3535
36− let Right doc = parse "<test id=\"1\" extra=\"2\" /><test id=\"2\" /><b><test id=\"3\" /></b><test id=\"4\" /><test />"
36+ let Right doc = parse "<test id=\"1\" extra=\"2\" />\n<test id=\"2\" /><b><test id=\"3\" /></b><test id=\"4\" /><test />"
3737 map name (children doc) === ["test","test","b","test","test"]
38+ location (children doc !! 2) === (2,16)
3839 length (childrenBy doc "test") === 4
3940 length (childrenBy doc "b") === 1
4041 length (childrenBy doc "extra") === 0