extern crate rcalc; #[cfg(test)] mod tests { use rcalc::Interpreter; #[test] fn it_handles_whitespace() { assert_eq!(Interpreter::process("3 - 4").unwrap(), -1.); } #[test] fn it_handles_numbers_of_more_than_one_digit() { assert_eq!(Interpreter::process("22 * 55").unwrap(), 1210.); } #[test] fn it_does_serial_mathematics() { assert_eq!(Interpreter::process("3 + 4 - 5 + 7").unwrap(), 9.); } }