(.module: [library [lux "*" ["_" test {"+" [Test]}] [abstract [monad {"+" [do]}] [\\specification ["$[0]" equivalence]]] [math ["[0]" random {"+" [Random]}]]]] [\\library ["[0]" / ["/[1]" // "_" ["i" int] ["[1][0]" i64]]]]) (def: .public random (Random /.I32) (# random.functor each /.i32 random.i64)) (def: .public test Test (<| (_.covering /._) (_.for [/.I32]) (do [! random.monad] [.let [limit (|> (-- /.width) //i64.mask .int ++)] expected (# ! each (i.% limit) random.int)] ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) (_.cover [/.i32 /.i64 /.width] (let [actual (|> expected .i64 /.i32 /.i64)] (# //i64.equivalence = expected actual))) ))))