(.require [library [lux (.except) [abstract [monad (.only do)]] [control ["[0]" try] ["[0]" exception] ["<>" parser]] [data ["[0]" text (.use "[1]#[0]" equivalence)] [format ["[0]" xml (.only) ["<[1]>" \\parser]]]] [math ["[0]" random]] [test ["_" property (.only Test)]]]] [// ["@[0]" profile]] [\\program ["[0]" / (.only) ["/[1]" // ["[1]" profile]]]]) (def .public test Test (<| (_.covering /._) (all _.and (_.coverage [/.file] (|> /.file (text#= "") not)) (do random.monad [expected @profile.random] (_.coverage [/.write /.parser] (when [(/.write expected) (the //.#identity expected)] [{try.#Success pom} {.#Some _}] (when (.result /.parser (list pom)) {try.#Success actual} (of //.equivalence = (|> (of //.monoid identity) (has //.#dependencies (the //.#dependencies expected)) (has //.#repositories (the //.#repositories expected))) actual) {try.#Failure error} false) [{try.#Failure error} {.#None}] (exception.match? //.no_identity error) _ false))) )))