From 7a3195fbd9d12c27c15b1a34e3a35cb2b90cd060 Mon Sep 17 00:00:00 2001 From: Dimitar Apostolovski Date: Fri, 1 Nov 2024 13:21:00 +0100 Subject: [PATCH] Sync Rectangles tests with problem spec --- exercises/practice/rectangles/.meta/config.json | 3 ++- exercises/practice/rectangles/.meta/tests.toml | 16 +++++++++++++--- exercises/practice/rectangles/rectangles.spec.js | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/exercises/practice/rectangles/.meta/config.json b/exercises/practice/rectangles/.meta/config.json index 517f30a724..312cda8153 100644 --- a/exercises/practice/rectangles/.meta/config.json +++ b/exercises/practice/rectangles/.meta/config.json @@ -6,7 +6,8 @@ "ankorGH", "SleeplessByte", "tejasbubane", - "xarxziux" + "xarxziux", + "themetar" ], "files": { "solution": [ diff --git a/exercises/practice/rectangles/.meta/tests.toml b/exercises/practice/rectangles/.meta/tests.toml index 63cd6c4d9a..282015033a 100644 --- a/exercises/practice/rectangles/.meta/tests.toml +++ b/exercises/practice/rectangles/.meta/tests.toml @@ -1,6 +1,13 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. [485b7bab-4150-40aa-a8db-73013427d08c] description = "no rows" @@ -40,3 +47,6 @@ description = "corner is required for a rectangle to be complete" [d78fe379-8c1b-4d3c-bdf7-29bfb6f6dc66] description = "large input with many rectangles" + +[6ef24e0f-d191-46da-b929-4faca24b4cd2] +description = "rectangles must have four sides" diff --git a/exercises/practice/rectangles/rectangles.spec.js b/exercises/practice/rectangles/rectangles.spec.js index 9ee7fa4c01..df5befb0ec 100644 --- a/exercises/practice/rectangles/rectangles.spec.js +++ b/exercises/practice/rectangles/rectangles.spec.js @@ -112,4 +112,19 @@ describe('Rectangles', () => { expect(actual).toEqual(expected); }); + + xtest('rectangles must have four sides', () => { + const expected = 5; + const actual = count([ + "+-+ +-+", + "| | | |", + "+-+-+-+", + " | | ", + "+-+-+-+", + "| | | |", + "+-+ +-+" + ]); + + expect(actual).toEqual(expected); + }); });