@@ -45,7 +45,14 @@ main = do
46 Right _ <- return $ parse $ "<test " <> BS.unwords [BS.pack $ "x" ++ show i ++ "='value'" | i <- [1..10000]] <> " />"
46 Right _ <- return $ parse $ "<test " <> BS.unwords [BS.pack $ "x" ++ show i ++ "='value'" | i <- [1..10000]] <> " />"
47 Right _ <- return $ parse $ BS.unlines $ replicate 10000 "<test x='value' />"
47 Right _ <- return $ parse $ BS.unlines $ replicate 10000 "<test x='value' />"
49+ let attrs = ["usd:jpy","test","extra","more","stuff","jpy:usd","xxx","xxxx"]
50+ Right doc <- return $ parse $ "<test " <> BS.unwords [x <> "='" <> x <> "'" | x <- attrs] <> ">middle</test>"
48− return ()
51+ [c] <- return $ childrenBy doc "test"
52+ forM_ attrs $ \a -> attributeBy c a === Just (Attribute a a)
53+ forM_ ["missing","gone","nothing"] $ \a -> attributeBy c a === Nothing
50a === b = if a == b then putStrLn "success" else fail "mismatch"
57a === b = if a == b then putStrLn "success" else fail "mismatch"