Commit 4cce6006 authored by Jacob Lifshay's avatar Jacob Lifshay

implemented test_from_ratio

parent f41b4ca5
......@@ -753,7 +753,12 @@ mod tests {
#[test]
fn test_from_ratio() {
unimplemented!("add more test cases");
assert_same!(DFI::from_ratio(r(2, 3), 8), DFI::new(bi(170), bi(171), 8));
assert_same!(
DFI::from_ratio(r(-2, 3), 8),
DFI::new(bi(-171), bi(-170), 8)
);
assert_same!(DFI::from_ratio(r(1, 8), 8), DFI::new(bi(32), bi(32), 8));
}
#[test]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment