Added tests for only one side being zero
Currently, if all sides are zero, the triangle is deemed invalid. But if any side is zero, that is also an invalid triangle.
@@ -15,6 +15,30 @@ fn zero_length_sides_are_illegal() {
assert!(triangle.is_none());
}
+#[test]
+#[ignore]
+fn one_length_zero_side_first() {
+ let sides = [0, 2, 2];
+ let triangle = Triangle::build(sides);
+ assert!(triangle.is_none());
+}
+
+#[test]
+#[ignore]
+fn one_length_zero_side_second() {
+ let sides = [2, 0, 2];
+ let triangle = Triangle::build(sides);
+ assert!(triangle.is_none());
+}
+
+#[test]
+#[ignore]
+fn one_length_zero_side_third() {
+ let sides = [2, 2, 0];
+ let triangle = Triangle::build(sides);
+ assert!(triangle.is_none());
+}
+
#[test]
#[ignore]
fn equilateral_triangles_have_equal_sides() {
