assert_eq!(parse("0°1680′0″0‴").unwrap(), 1054200000000000); assert_eq!( Sat(1914226250000000).degree().to_string(), "0°122762′794″0‴" ); assert_eq!(parse("0°122762′794″0‴").unwrap(), 1914226250000000); } #[test] fn period() { assert_eq!(Sat(0).period(), 0); assert_eq!(Sat(10080000000000).period(), 1); assert_eq!(Sat(2099999997689999).period(), 3437); assert_eq!(Sat(10075000000000).period(), 0); assert_eq!(Sat(10080000000000 - 1).period(), 0); assert_eq!(Sat(10080000000000).period(), 1); assert_eq!(Sat(10080000000000 + 1).period(), 1); assert_eq!(Sat(10085000000000).period(), 1); assert_eq!(Sat(2099999997689999).period(), 3437); } #[test] fn epoch() { assert_eq!(Sat(0).epoch(), 0); assert_eq!(Sat(1).epoch(), 0); assert_eq!( Sat(50 * COIN_VALUE * u64::from(SUBSIDY_HALVING_INTERVAL)).epoch(), 1 ); assert_eq!(Sat(2099999997689999).epoch(), 32); } #[test] fn epoch_position() { assert_eq!(Epoch(0).starting_sat().epoch_position(), 0);