use conformal; use std::cli; fn check(ok: bool) { if !ok { stderr_line("conformal check failed"); process_exit(1); } } fn main() { check(cf_rank(4, 3, 5) == 3 && cf_rank(9, 9, 10) == 9); check(cf_rank(2, 9, 10) == 3 && len(cf_radius([1, 2], 9, 10)) == 0); check(cf_rank(9007199254740991, 999999, 1000000) > 0 && cf_rank(9, 0, 10) == 0); check(at(cf_radius([4, 2, 1, 2, 4], 1, 2), 0) == 2.0); check(at(cf_radius([0, 0, 0, 0], 3, 5), 0) == 0.0); check(at(cf_radius([0, 1e-300, 1e300, 1, 2], 1, 2), 0) == 1.0); check(at(cf_radius([1.0, 1.0000000000000002], 1, 3), 0) == 1.0); check(at(cf_radius([1.0, 1.0000000000000002], 2, 3), 0) == 1.0000000000000002); let cal = cf_calibrate([10, 12, 7, 11], [10, 10, 10, 10], 3, 5); check(at(cal, 0) == 2.0 && at(cal, 1) == 3.0 && at(cal, 2) == 4.0); let interval = cf_interval(20.0, at(cal, 0)); check(at(interval, 0) == 18.0 && at(interval, 1) == 22.0); check(cf_coverage([8, 10, 13, 12], [10, 10, 10, 10], 2.0) == 0.75); check(len(cf_radius([1, -1, 2], 1, 2)) == 0 && len(cf_calibrate([1], [], 1, 2)) == 0); check(len(cf_interval(1e308, 1e308)) == 0 && cf_coverage([], [], 1.0) == -1.0); check(len(cf_radius([0.0 / 0.0, 1], 1, 2)) == 0); println!("conformal checks passed"); }