rpn-calculator: Test missing operands & intermediate error
@@ -73,3 +73,17 @@ fn test_too_many_operands_returns_none() {
let input = calculator_input("2 2");
assert_eq!(evaluate(&input), None);
}
+
+#[test]
+#[ignore]
+fn test_zero_operands_returns_none() {
+ let input = calculator_input("+");
+ assert_eq!(evaluate(&input), None);
+}
+
+#[test]
+#[ignore]
+fn test_intermediate_error_returns_none() {
+ let input = calculator_input("+ 2 2 *");
+ assert_eq!(evaluate(&input), None);
+}
