https://gitlab.inria.fr/abrenon/soprano
Tip revision: 3fc6efcf5444dee0c690d4d57aab06a50593ad8a authored by Alice Brenon on 25 November 2025, 13:33:00 UTC
Switch license to GPLv3 (https://www.gnu.org/licenses/gpl.html)
Switch license to GPLv3 (https://www.gnu.org/licenses/gpl.html)
Tip revision: 3fc6efc
XML.hs
module XML (
testXPath
) where
import Distribution.TestSuite (Progress(..), Result(..), Test, testGroup)
import Mock.Resource (simpleTest)
import Mock.XML as XML (getTextBlocks, load)
testXPath :: Test
testXPath = testGroup "xPath" $ openTextBlock <$> files
where
files = ["peritext_T1p77", "peritext_T1p845", "caption_T1p834"]
openTextBlock fileName = simpleTest ("xPath - " ++ fileName) [] $ do
input <- XML.load fileName
return . Finished $ case XML.getTextBlocks input of
[_] -> Pass
l -> Fail $
(if null l then "No" else "More than 1") ++ " TextBlock found in " ++ fileName
