diff --git a/src/lib.rs b/src/lib.rs index 2b762ea..c567a16 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -168,6 +168,18 @@ pub mod xyk { ); } + #[test] + fn calculate_spot_price_has_better_precision() { + assert_ne!( + xyk::calculate_spot_price(String::from("5039030951140853000"), String::from("6987280000000000")), + "0" + ); + assert_eq!( + xyk::get_spot_price(String::from("5039030951140853000"), String::from("6987280000000000"), String::from("100")), + "0" + ); + } + #[test] fn out_in_works() { assert_eq!(