(.module: [library [lux #* ["_" test (#+ Test)] [abstract [monad (#+ do)]] [control ["." try] ["." exception] ["<>" parser ["<.>" xml]]] [data ["." text ("#\." equivalence)] [format ["." xml]]] [math ["." random]]]] [// ["@." profile]] [\\program ["." / ["/#" // #_ ["#" profile]]]]) (def: .public test Test (<| (_.covering /._) ($_ _.and (_.cover [/.file] (|> /.file (text\= "") not)) (do random.monad [expected @profile.random] (_.cover [/.write /.parser] (case [(/.write expected) (value@ #//.identity expected)] [(#try.Success pom) (#.Some _)] (case (.result /.parser (list pom)) (#try.Success actual) (\ //.equivalence = (|> (\ //.monoid identity) (with@ #//.dependencies (value@ #//.dependencies expected)) (with@ #//.repositories (value@ #//.repositories expected))) actual) (#try.Failure error) false) [(#try.Failure error) #.None] (exception.match? //.no_identity error) _ false))) )))