From 1daa13ff959aa3b024d6d63db3ae4a19e5def792 Mon Sep 17 00:00:00 2001 From: Eric Willigers Date: Fri, 3 Jan 2025 06:41:43 +1100 Subject: [PATCH] Sync exercises [no important files changed] --- .../armstrong-numbers/.meta/tests.toml | 37 ++++++++---- exercises/practice/bob/.meta/tests.toml | 5 ++ exercises/practice/bob/bob.spec.js | 12 ++-- .../collatz-conjecture/.meta/tests.toml | 23 +++++++- .../collatz-conjecture.spec.js | 2 +- exercises/practice/pangram/.meta/tests.toml | 18 +++++- exercises/practice/pangram/pangram.spec.js | 4 +- exercises/practice/triangle/.meta/tests.toml | 57 ++++++++++++------- exercises/practice/triangle/triangle.spec.js | 10 +++- 9 files changed, 119 insertions(+), 49 deletions(-) diff --git a/exercises/practice/armstrong-numbers/.meta/tests.toml b/exercises/practice/armstrong-numbers/.meta/tests.toml index fdada6d..b956bdf 100644 --- a/exercises/practice/armstrong-numbers/.meta/tests.toml +++ b/exercises/practice/armstrong-numbers/.meta/tests.toml @@ -1,30 +1,45 @@ -# 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. [c1ed103c-258d-45b2-be73-d8c6d9580c7b] description = "Zero is an Armstrong number" [579e8f03-9659-4b85-a1a2-d64350f6b17a] -description = "Single digit numbers are Armstrong numbers" +description = "Single-digit numbers are Armstrong numbers" [2d6db9dc-5bf8-4976-a90b-b2c2b9feba60] -description = "There are no 2 digit Armstrong numbers" +description = "There are no two-digit Armstrong numbers" [509c087f-e327-4113-a7d2-26a4e9d18283] -description = "Three digit number that is an Armstrong number" +description = "Three-digit number that is an Armstrong number" [7154547d-c2ce-468d-b214-4cb953b870cf] -description = "Three digit number that is not an Armstrong number" +description = "Three-digit number that is not an Armstrong number" [6bac5b7b-42e9-4ecb-a8b0-4832229aa103] -description = "Four digit number that is an Armstrong number" +description = "Four-digit number that is an Armstrong number" [eed4b331-af80-45b5-a80b-19c9ea444b2e] -description = "Four digit number that is not an Armstrong number" +description = "Four-digit number that is not an Armstrong number" [f971ced7-8d68-4758-aea1-d4194900b864] -description = "Seven digit number that is an Armstrong number" +description = "Seven-digit number that is an Armstrong number" [7ee45d52-5d35-4fbd-b6f1-5c8cd8a67f18] -description = "Seven digit number that is not an Armstrong number" +description = "Seven-digit number that is not an Armstrong number" + +[5ee2fdf8-334e-4a46-bb8d-e5c19c02c148] +description = "Armstrong number containing seven zeroes" +include = false + +[12ffbf10-307a-434e-b4ad-c925680e1dd4] +description = "The largest and last Armstrong number" +include = false diff --git a/exercises/practice/bob/.meta/tests.toml b/exercises/practice/bob/.meta/tests.toml index ea47d6b..5299e28 100644 --- a/exercises/practice/bob/.meta/tests.toml +++ b/exercises/practice/bob/.meta/tests.toml @@ -71,6 +71,7 @@ description = "alternate silence" [66953780-165b-4e7e-8ce3-4bcb80b6385a] description = "multiple line question" +include = false [5371ef75-d9ea-4103-bcfa-2da973ddec1b] description = "starting with whitespace" @@ -83,3 +84,7 @@ description = "other whitespace" [12983553-8601-46a8-92fa-fcaa3bc4a2a0] description = "non-question ending with whitespace" + +[2c7278ac-f955-4eb4-bf8f-e33eb4116a15] +description = "multiple line question" +reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a" diff --git a/exercises/practice/bob/bob.spec.js b/exercises/practice/bob/bob.spec.js index 65b562a..55539b6 100644 --- a/exercises/practice/bob/bob.spec.js +++ b/exercises/practice/bob/bob.spec.js @@ -172,12 +172,6 @@ describe("Bob", () => { expect(actual).toEqual(expected); }); - xtest("multiple line question", () => { - const expected = "Whatever."; - const actual = response("\nDoes this cryogenic chamber make me look fat?\nNo."); - expect(actual).toEqual(expected); - }); - xtest("starting with whitespace", () => { const expected = "Whatever."; const actual = response(" hmmmmmmm..."); @@ -201,4 +195,10 @@ describe("Bob", () => { const actual = response("This is a statement ending with whitespace "); expect(actual).toEqual(expected); }); + + xtest("multiple line question", () => { + const expected = "Sure."; + const actual = response("\nDoes this cryogenic chamber make\n me look fat?"); + expect(actual).toEqual(expected); + }); }); diff --git a/exercises/practice/collatz-conjecture/.meta/tests.toml b/exercises/practice/collatz-conjecture/.meta/tests.toml index 04187f6..cc34e16 100644 --- a/exercises/practice/collatz-conjecture/.meta/tests.toml +++ b/exercises/practice/collatz-conjecture/.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. [540a3d51-e7a6-47a5-92a3-4ad1838f0bfd] description = "zero steps for one" @@ -16,6 +23,16 @@ description = "large number of even and odd steps" [7d4750e6-def9-4b86-aec7-9f7eb44f95a3] description = "zero is an error" +include = false + +[2187673d-77d6-4543-975e-66df6c50e2da] +description = "zero is an error" +reimplements = "7d4750e6-def9-4b86-aec7-9f7eb44f95a3" [c6c795bf-a288-45e9-86a1-841359ad426d] description = "negative value is an error" +include = false + +[ec11f479-56bc-47fd-a434-bcd7a31a7a2e] +description = "negative value is an error" +reimplements = "c6c795bf-a288-45e9-86a1-841359ad426d" diff --git a/exercises/practice/collatz-conjecture/collatz-conjecture.spec.js b/exercises/practice/collatz-conjecture/collatz-conjecture.spec.js index 735fe3d..b6b0ace 100644 --- a/exercises/practice/collatz-conjecture/collatz-conjecture.spec.js +++ b/exercises/practice/collatz-conjecture/collatz-conjecture.spec.js @@ -38,7 +38,7 @@ describe("steps()", () => { expect(currentInstance.exports.steps(16)).toEqual(4); }); - xtest("even and odd currentInstance.exports.steps", () => { + xtest("even and odd steps", () => { expect(currentInstance.exports.steps(12)).toEqual(9); }); diff --git a/exercises/practice/pangram/.meta/tests.toml b/exercises/practice/pangram/.meta/tests.toml index 8075c5b..10b5a33 100644 --- a/exercises/practice/pangram/.meta/tests.toml +++ b/exercises/practice/pangram/.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. [64f61791-508e-4f5c-83ab-05de042b0149] description = "empty sentence" @@ -31,3 +38,8 @@ description = "mixed case and punctuation" [2577bf54-83c8-402d-a64b-a2c0f7bb213a] description = "case insensitive" +include = false + +[7138e389-83e4-4c6e-8413-1e40a0076951] +description = "a-m and A-M are 26 different characters but not a pangram" +reimplements = "2577bf54-83c8-402d-a64b-a2c0f7bb213a" diff --git a/exercises/practice/pangram/pangram.spec.js b/exercises/practice/pangram/pangram.spec.js index b1d1687..385f226 100644 --- a/exercises/practice/pangram/pangram.spec.js +++ b/exercises/practice/pangram/pangram.spec.js @@ -89,7 +89,7 @@ describe("Pangram()", () => { expect(isPangram('"Five quacking Zephyrs jolt my wax bed."')).toBe(1); }); - xtest("case insensitive", () => { - expect(isPangram("the quick brown fox jumps over with lazy FX")).toBe(0); + xtest("a-m and A-M are 26 different characters but not a pangram", () => { + expect(isPangram("abcdefghijklm ABCDEFGHIJKLM")).toBe(0); }); }); diff --git a/exercises/practice/triangle/.meta/tests.toml b/exercises/practice/triangle/.meta/tests.toml index 5910705..7db0916 100644 --- a/exercises/practice/triangle/.meta/tests.toml +++ b/exercises/practice/triangle/.meta/tests.toml @@ -1,60 +1,73 @@ -# 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. [8b2c43ac-7257-43f9-b552-7631a91988af] -description = "all sides are equal" +description = "equilateral triangle -> all sides are equal" [33eb6f87-0498-4ccf-9573-7f8c3ce92b7b] -description = "any side is unequal" +description = "equilateral triangle -> any side is unequal" [c6585b7d-a8c0-4ad8-8a34-e21d36f7ad87] -description = "no sides are equal" +description = "equilateral triangle -> no sides are equal" [16e8ceb0-eadb-46d1-b892-c50327479251] -description = "all zero sides is not a triangle" +description = "equilateral triangle -> all zero sides is not a triangle" [3022f537-b8e5-4cc1-8f12-fd775827a00c] -description = "sides may be floats" +description = "equilateral triangle -> sides may be floats" [cbc612dc-d75a-4c1c-87fc-e2d5edd70b71] -description = "last two sides are equal" +description = "isosceles triangle -> last two sides are equal" [e388ce93-f25e-4daf-b977-4b7ede992217] -description = "first two sides are equal" +description = "isosceles triangle -> first two sides are equal" [d2080b79-4523-4c3f-9d42-2da6e81ab30f] -description = "first and last sides are equal" +description = "isosceles triangle -> first and last sides are equal" [8d71e185-2bd7-4841-b7e1-71689a5491d8] -description = "equilateral triangles are also isosceles" +description = "isosceles triangle -> equilateral triangles are also isosceles" [840ed5f8-366f-43c5-ac69-8f05e6f10bbb] -description = "no sides are equal" +description = "isosceles triangle -> no sides are equal" [2eba0cfb-6c65-4c40-8146-30b608905eae] -description = "first triangle inequality violation" +description = "isosceles triangle -> first triangle inequality violation" [278469cb-ac6b-41f0-81d4-66d9b828f8ac] -description = "second triangle inequality violation" +description = "isosceles triangle -> second triangle inequality violation" [90efb0c7-72bb-4514-b320-3a3892e278ff] -description = "third triangle inequality violation" +description = "isosceles triangle -> third triangle inequality violation" [adb4ee20-532f-43dc-8d31-e9271b7ef2bc] -description = "sides may be floats" +description = "isosceles triangle -> sides may be floats" [e8b5f09c-ec2e-47c1-abec-f35095733afb] -description = "no sides are equal" +description = "scalene triangle -> no sides are equal" [2510001f-b44d-4d18-9872-2303e7977dc1] -description = "all sides are equal" +description = "scalene triangle -> all sides are equal" [c6e15a92-90d9-4fb3-90a2-eef64f8d3e1e] -description = "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 = "may not violate triangle inequality" +description = "scalene triangle -> may not violate triangle inequality" [26d9d59d-f8f1-40d3-ad58-ae4d54123d7d] -description = "sides may be floats" +description = "scalene triangle -> sides may be floats" diff --git a/exercises/practice/triangle/triangle.spec.js b/exercises/practice/triangle/triangle.spec.js index 991a185..0325d88 100644 --- a/exercises/practice/triangle/triangle.spec.js +++ b/exercises/practice/triangle/triangle.spec.js @@ -99,10 +99,18 @@ describe("Triangle", () => { expect(currentInstance.exports.isScalene(4, 4, 4)).toBe(0); }); - xtest("two sides are equal", () => { + xtest("first and second sides are equal", () => { expect(currentInstance.exports.isScalene(4, 4, 3)).toBe(0); }); + xtest("first and third sides are equal", () => { + expect(currentInstance.exports.isScalene(3, 4, 3)).toBe(0); + }); + + xtest("second and third sides are equal", () => { + expect(currentInstance.exports.isScalene(4, 3, 3)).toBe(0); + }); + xtest("may not violate triangle inequality", () => { expect(currentInstance.exports.isScalene(7, 3, 2)).toBe(0); });