From 5577cb51fba66359073753e7e9ef6e8d5d2bcdf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20B=20Nagy?= <20251272+BNAndras@users.noreply.github.com> Date: Sat, 23 Dec 2023 21:20:47 -0800 Subject: [PATCH] Update missing triangle tests --- exercises/practice/triangle/.meta/tests.toml | 8 +++++++- exercises/practice/triangle/TriangleTest.cfc | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/exercises/practice/triangle/.meta/tests.toml b/exercises/practice/triangle/.meta/tests.toml index b4f4175..7db0916 100644 --- a/exercises/practice/triangle/.meta/tests.toml +++ b/exercises/practice/triangle/.meta/tests.toml @@ -58,7 +58,13 @@ description = "scalene triangle -> no sides are equal" description = "scalene triangle -> all sides are equal" [c6e15a92-90d9-4fb3-90a2-eef64f8d3e1e] -description = "scalene triangle -> two sides are equal" +description = "scalene triangle -> first and second sides are equal" + +[3da23a91-a166-419a-9abf-baf4868fd985] +description = "scalene triangle -> first and third sides are equal" + +[b6a75d98-1fef-4c42-8e9a-9db854ba0a4d] +description = "scalene triangle -> second and third sides are equal" [70ad5154-0033-48b7-af2c-b8d739cd9fdc] description = "scalene triangle -> may not violate triangle inequality" diff --git a/exercises/practice/triangle/TriangleTest.cfc b/exercises/practice/triangle/TriangleTest.cfc index 97e2e7c..f775a34 100644 --- a/exercises/practice/triangle/TriangleTest.cfc +++ b/exercises/practice/triangle/TriangleTest.cfc @@ -74,10 +74,18 @@ component extends="testbox.system.BaseSpec" { expect( SUT.scalene( sides=[4, 4, 4] ) ).toBeFalse(); }); - it( 'false if two sides are equal', function(){ + it( 'false if first and second sides are equal', function(){ expect( SUT.scalene( sides=[4, 4, 3] ) ).toBeFalse(); }); + it( 'false if first and third sides are equal', function(){ + expect( SUT.scalene( sides=[3, 4, 3] ) ).toBeFalse(); + }); + + it( 'false if second and third sides are equal', function(){ + expect( SUT.scalene( sides=[4, 3, 3] ) ).toBeFalse(); + }); + it( 'Sides that violate triangle inequality are not scalene, even if they are all different', function(){ expect( SUT.scalene( sides=[7, 3, 2] ) ).toBeFalse(); });