(.module: [library [lux "*" ["_" test {"+" Test}] [abstract [monad {"+" do}]] [control ["[0]" try] ["[0]" exception] ["<>" parser ["<[0]>" xml]]] [data ["[0]" text ("[1]#[0]" equivalence)] [format ["[0]" xml]]] [math ["[0]" random]]]] [// ["@[0]" profile]] [\\program ["[0]" / ["/[1]" // "_" ["[1]" 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))) )))