diff --git a/exercises/practice/anagram/.meta/config.json b/exercises/practice/anagram/.meta/config.json index 841366443..aa1989af0 100644 --- a/exercises/practice/anagram/.meta/config.json +++ b/exercises/practice/anagram/.meta/config.json @@ -27,7 +27,7 @@ "flag.tests.includes-optional": false, "flag.tests.jest": true, "flag.tests.tstyche": false - } + }, "source": "Inspired by the Extreme Startup game", "source_url": "https://github.com/rchatley/extreme_startup" } diff --git a/exercises/practice/bob/.meta/tests.toml b/exercises/practice/bob/.meta/tests.toml index 630485579..c6a464960 100644 --- a/exercises/practice/bob/.meta/tests.toml +++ b/exercises/practice/bob/.meta/tests.toml @@ -1,18 +1,28 @@ -# 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. -[e162fead-606f-437a-a166-d051915cea8e] -description = "stating something" +[8a2e771d-d6f1-4e3f-b6c6-b41495556e37] +description = "asking a question" [73a966dc-8017-47d6-bb32-cf07d1a5fcd9] description = "shouting" -[d6c98afd-df35-4806-b55e-2c457c3ab748] -description = "shouting gibberish" +[a5193c61-4a92-4f68-93e2-f554eb385ec6] +description = "forceful question" -[8a2e771d-d6f1-4e3f-b6c6-b41495556e37] -description = "asking a question" +[bc39f7c6-f543-41be-9a43-fd1c2f753fc0] +description = "silence" + +[e162fead-606f-437a-a166-d051915cea8e] +description = "stating something" [81080c62-4e4d-4066-b30a-48d8d76920d9] description = "asking a numeric question" @@ -20,23 +30,34 @@ description = "asking a numeric question" [2a02716d-685b-4e2e-a804-2adaf281c01e] description = "asking gibberish" -[c02f9179-ab16-4aa7-a8dc-940145c385f7] -description = "talking forcefully" +[bb0011c5-cd52-4a5b-8bfb-a87b6283b0e2] +description = "question with no letters" -[153c0e25-9bb5-4ec5-966e-598463658bcd] -description = "using acronyms in regular speech" +[9bfc677d-ea3a-45f2-be44-35bc8fa3753e] +description = "non-letters with question" -[a5193c61-4a92-4f68-93e2-f554eb385ec6] -description = "forceful question" +[8608c508-f7de-4b17-985b-811878b3cf45] +description = "prattling on" -[a20e0c54-2224-4dde-8b10-bd2cdd4f61bc] -description = "shouting numbers" +[05b304d6-f83b-46e7-81e0-4cd3ca647900] +description = "ending with whitespace" -[f7bc4b92-bdff-421e-a238-ae97f230ccac] -description = "no letters" +[66953780-165b-4e7e-8ce3-4bcb80b6385a] +description = "multiple line question" +include = false -[bb0011c5-cd52-4a5b-8bfb-a87b6283b0e2] -description = "question with no letters" +[2c7278ac-f955-4eb4-bf8f-e33eb4116a15] +description = "multiple line question" +reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a" + +[d6c98afd-df35-4806-b55e-2c457c3ab748] +description = "shouting gibberish" + +[3c954328-86fb-4c71-8961-e18d6a5e2517] +description = "shouting a statement containing a question mark" + +[a20e0c54-2224-4dde-8b10-bd2cdd4f61bc] +description = "shouting numbers" [496143c8-1c31-4c01-8a08-88427af85c66] description = "shouting with special characters" @@ -44,35 +65,29 @@ description = "shouting with special characters" [e6793c1c-43bd-4b8d-bc11-499aea73925f] description = "shouting with no exclamation mark" -[aa8097cc-c548-4951-8856-14a404dd236a] -description = "statement containing question mark" - -[9bfc677d-ea3a-45f2-be44-35bc8fa3753e] -description = "non-letters with question" - -[8608c508-f7de-4b17-985b-811878b3cf45] -description = "prattling on" - -[bc39f7c6-f543-41be-9a43-fd1c2f753fc0] -description = "silence" - [d6c47565-372b-4b09-b1dd-c40552b8378b] description = "prolonged silence" [4428f28d-4100-4d85-a902-e5a78cb0ecd3] description = "alternate silence" -[66953780-165b-4e7e-8ce3-4bcb80b6385a] -description = "multiple line question" +[72bd5ad3-9b2f-4931-a988-dce1f5771de2] +description = "other whitespace" -[5371ef75-d9ea-4103-bcfa-2da973ddec1b] -description = "starting with whitespace" +[c02f9179-ab16-4aa7-a8dc-940145c385f7] +description = "talking forcefully" -[05b304d6-f83b-46e7-81e0-4cd3ca647900] -description = "ending with whitespace" +[153c0e25-9bb5-4ec5-966e-598463658bcd] +description = "using acronyms in regular speech" -[72bd5ad3-9b2f-4931-a988-dce1f5771de2] -description = "other whitespace" +[f7bc4b92-bdff-421e-a238-ae97f230ccac] +description = "no letters" + +[aa8097cc-c548-4951-8856-14a404dd236a] +description = "statement containing question mark" + +[5371ef75-d9ea-4103-bcfa-2da973ddec1b] +description = "starting with whitespace" [12983553-8601-46a8-92fa-fcaa3bc4a2a0] description = "non-question ending with whitespace" diff --git a/exercises/practice/bob/bob.test.ts b/exercises/practice/bob/bob.test.ts index cee3f5ef2..de50906ef 100644 --- a/exercises/practice/bob/bob.test.ts +++ b/exercises/practice/bob/bob.test.ts @@ -2,9 +2,9 @@ import { describe, it, expect, xit } from '@jest/globals' import { hey } from './bob.ts' describe('Bob', () => { - it('stating something', () => { - const result = hey('Tom-ay-to, tom-aaaah-to.') - expect(result).toEqual('Whatever.') + it('asking a question', () => { + const result = hey('Does this cryogenic chamber make me look fat?') + expect(result).toEqual('Sure.') }) xit('shouting', () => { @@ -12,14 +12,19 @@ describe('Bob', () => { expect(result).toEqual('Whoa, chill out!') }) - xit('shouting gibberish', () => { - const result = hey('FCECDFCAAB') - expect(result).toEqual('Whoa, chill out!') + xit('forceful question', () => { + const result = hey("WHAT'S GOING ON?") + expect(result).toEqual("Calm down, I know what I'm doing!") }) - xit('asking a question', () => { - const result = hey('Does this cryogenic chamber make me look fat?') - expect(result).toEqual('Sure.') + xit('silence', () => { + const result = hey('') + expect(result).toEqual('Fine. Be that way!') + }) + + xit('stating something', () => { + const result = hey('Tom-ay-to, tom-aaaah-to.') + expect(result).toEqual('Whatever.') }) xit('asking a numeric question', () => { @@ -32,63 +37,58 @@ describe('Bob', () => { expect(result).toEqual('Sure.') }) - xit('talking forcefully', () => { - const result = hey("Let's go make out behind the gym!") - expect(result).toEqual('Whatever.') - }) - - xit('using acronyms in regular speech', () => { - const result = hey("It's OK if you don't want to go to the DMV.") - expect(result).toEqual('Whatever.') + xit('question with no letters', () => { + const result = hey('4?') + expect(result).toEqual('Sure.') }) - xit('forceful question', () => { - const result = hey('WHAT THE HELL WERE YOU THINKING?') - expect(result).toEqual("Calm down, I know what I'm doing!") + xit('non-letters with question', () => { + const result = hey(':) ?') + expect(result).toEqual('Sure.') }) - xit('shouting numbers', () => { - const result = hey('1, 2, 3 GO!') - expect(result).toEqual('Whoa, chill out!') + xit('prattling on', () => { + const result = hey('Wait! Hang on. Are you going to be OK?') + expect(result).toEqual('Sure.') }) - xit('no letters', () => { - const result = hey('1, 2, 3') - expect(result).toEqual('Whatever.') + xit('ending with whitespace', () => { + const result = hey('Okay if like my spacebar quite a bit? ') + expect(result).toEqual('Sure.') }) - xit('question with no letters', () => { - const result = hey('4?') + xit('multiple line question', () => { + const result = hey('\nDoes this cryogenic chamber make\n me look fat?') expect(result).toEqual('Sure.') }) - xit('shouting with special characters', () => { - const result = hey('ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!') + xit('shouting gibberish', () => { + const result = hey('FCECDFCAAB') expect(result).toEqual('Whoa, chill out!') }) - xit('shouting with no exclamation mark', () => { - const result = hey('I HATE THE DMV') + xit('shouting a statement containing a question mark', () => { + const result = hey('DO LIONS EAT PEOPLE? AHHHHH.') expect(result).toEqual('Whoa, chill out!') }) - xit('statement containing question mark', () => { - const result = hey('Ending with ? means a question.') - expect(result).toEqual('Whatever.') + xit('shouting numbers', () => { + const result = hey('1, 2, 3 GO!') + expect(result).toEqual('Whoa, chill out!') }) - xit('prattling on', () => { - const result = hey('Wait! Hang on. Are you going to be OK?') - expect(result).toEqual('Sure.') + xit('shouting with special characters', () => { + const result = hey('ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!') + expect(result).toEqual('Whoa, chill out!') }) - xit('silence', () => { - const result = hey('') - expect(result).toEqual('Fine. Be that way!') + xit('shouting with no exclamation mark', () => { + const result = hey('I HATE THE DENTIST') + expect(result).toEqual('Whoa, chill out!') }) xit('prolonged silence', () => { - const result = hey(' ') + const result = hey(' ') expect(result).toEqual('Fine. Be that way!') }) @@ -97,24 +97,34 @@ describe('Bob', () => { expect(result).toEqual('Fine. Be that way!') }) - xit('multiple line question', () => { - const result = hey('\nDoes this cryogenic chamber make me look fat?\nNo.') + xit('other whitespace', () => { + const result = hey('\n\r \t') + expect(result).toEqual('Fine. Be that way!') + }) + + xit('talking forcefully', () => { + const result = hey('Hi there!') expect(result).toEqual('Whatever.') }) - xit('starting with whitespace', () => { - const result = hey(' hmmmmmmm...') + xit('using acronyms in regular speech', () => { + const result = hey("It's OK if you don't want to go work for NASA.") expect(result).toEqual('Whatever.') }) - xit('ending with whitespace', () => { - const result = hey('Okay if like my spacebar quite a bit? ') - expect(result).toEqual('Sure.') + xit('no letters', () => { + const result = hey('1, 2, 3') + expect(result).toEqual('Whatever.') }) - xit('other whitespace', () => { - const result = hey('\n\r \t') - expect(result).toEqual('Fine. Be that way!') + xit('statement containing question mark', () => { + const result = hey('Ending with ? means a question.') + expect(result).toEqual('Whatever.') + }) + + xit('starting with whitespace', () => { + const result = hey(' hmmmmmmm...') + expect(result).toEqual('Whatever.') }) xit('non-question ending with whitespace', () => { diff --git a/exercises/practice/complex-numbers/.meta/tests.toml b/exercises/practice/complex-numbers/.meta/tests.toml index d67ac05f5..dffb1f2a3 100644 --- a/exercises/practice/complex-numbers/.meta/tests.toml +++ b/exercises/practice/complex-numbers/.meta/tests.toml @@ -1,96 +1,130 @@ -# 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. [9f98e133-eb7f-45b0-9676-cce001cd6f7a] -description = "Real part of a purely real number" +description = "Real part -> Real part of a purely real number" [07988e20-f287-4bb7-90cf-b32c4bffe0f3] -description = "Real part of a purely imaginary number" +description = "Real part -> Real part of a purely imaginary number" [4a370e86-939e-43de-a895-a00ca32da60a] -description = "Real part of a number with real and imaginary part" +description = "Real part -> Real part of a number with real and imaginary part" [9b3fddef-4c12-4a99-b8f8-e3a42c7ccef6] -description = "Imaginary part of a purely real number" +description = "Imaginary part -> Imaginary part of a purely real number" [a8dafedd-535a-4ed3-8a39-fda103a2b01e] -description = "Imaginary part of a purely imaginary number" +description = "Imaginary part -> Imaginary part of a purely imaginary number" [0f998f19-69ee-4c64-80ef-01b086feab80] -description = "Imaginary part of a number with real and imaginary part" +description = "Imaginary part -> Imaginary part of a number with real and imaginary part" [a39b7fd6-6527-492f-8c34-609d2c913879] description = "Imaginary unit" [9a2c8de9-f068-4f6f-b41c-82232cc6c33e] -description = "Add purely real numbers" +description = "Arithmetic -> Addition -> Add purely real numbers" [657c55e1-b14b-4ba7-bd5c-19db22b7d659] -description = "Add purely imaginary numbers" +description = "Arithmetic -> Addition -> Add purely imaginary numbers" [4e1395f5-572b-4ce8-bfa9-9a63056888da] -description = "Add numbers with real and imaginary part" +description = "Arithmetic -> Addition -> Add numbers with real and imaginary part" [1155dc45-e4f7-44b8-af34-a91aa431475d] -description = "Subtract purely real numbers" +description = "Arithmetic -> Subtraction -> Subtract purely real numbers" [f95e9da8-acd5-4da4-ac7c-c861b02f774b] -description = "Subtract purely imaginary numbers" +description = "Arithmetic -> Subtraction -> Subtract purely imaginary numbers" [f876feb1-f9d1-4d34-b067-b599a8746400] -description = "Subtract numbers with real and imaginary part" +description = "Arithmetic -> Subtraction -> Subtract numbers with real and imaginary part" [8a0366c0-9e16-431f-9fd7-40ac46ff4ec4] -description = "Multiply purely real numbers" +description = "Arithmetic -> Multiplication -> Multiply purely real numbers" [e560ed2b-0b80-4b4f-90f2-63cefc911aaf] -description = "Multiply purely imaginary numbers" +description = "Arithmetic -> Multiplication -> Multiply purely imaginary numbers" [4d1d10f0-f8d4-48a0-b1d0-f284ada567e6] -description = "Multiply numbers with real and imaginary part" +description = "Arithmetic -> Multiplication -> Multiply numbers with real and imaginary part" [b0571ddb-9045-412b-9c15-cd1d816d36c1] -description = "Divide purely real numbers" +description = "Arithmetic -> Division -> Divide purely real numbers" [5bb4c7e4-9934-4237-93cc-5780764fdbdd] -description = "Divide purely imaginary numbers" +description = "Arithmetic -> Division -> Divide purely imaginary numbers" [c4e7fef5-64ac-4537-91c2-c6529707701f] -description = "Divide numbers with real and imaginary part" +description = "Arithmetic -> Division -> Divide numbers with real and imaginary part" [c56a7332-aad2-4437-83a0-b3580ecee843] -description = "Absolute value of a positive purely real number" +description = "Absolute value -> Absolute value of a positive purely real number" [cf88d7d3-ee74-4f4e-8a88-a1b0090ecb0c] -description = "Absolute value of a negative purely real number" +description = "Absolute value -> Absolute value of a negative purely real number" [bbe26568-86c1-4bb4-ba7a-da5697e2b994] -description = "Absolute value of a purely imaginary number with positive imaginary part" +description = "Absolute value -> Absolute value of a purely imaginary number with positive imaginary part" [3b48233d-468e-4276-9f59-70f4ca1f26f3] -description = "Absolute value of a purely imaginary number with negative imaginary part" +description = "Absolute value -> Absolute value of a purely imaginary number with negative imaginary part" [fe400a9f-aa22-4b49-af92-51e0f5a2a6d3] -description = "Absolute value of a number with real and imaginary part" +description = "Absolute value -> Absolute value of a number with real and imaginary part" [fb2d0792-e55a-4484-9443-df1eddfc84a2] -description = "Conjugate a purely real number" +description = "Complex conjugate -> Conjugate a purely real number" [e37fe7ac-a968-4694-a460-66cb605f8691] -description = "Conjugate a purely imaginary number" +description = "Complex conjugate -> Conjugate a purely imaginary number" [f7704498-d0be-4192-aaf5-a1f3a7f43e68] -description = "Conjugate a number with real and imaginary part" +description = "Complex conjugate -> Conjugate a number with real and imaginary part" [6d96d4c6-2edb-445b-94a2-7de6d4caaf60] -description = "Euler's identity/formula" +description = "Complex exponential function -> Euler's identity/formula" [2d2c05a0-4038-4427-a24d-72f6624aa45f] -description = "Exponential of 0" +description = "Complex exponential function -> Exponential of 0" [ed87f1bd-b187-45d6-8ece-7e331232c809] -description = "Exponential of a purely real number" +description = "Complex exponential function -> Exponential of a purely real number" [08eedacc-5a95-44fc-8789-1547b27a8702] -description = "Exponential of a number with real and imaginary part" +description = "Complex exponential function -> Exponential of a number with real and imaginary part" + +[d2de4375-7537-479a-aa0e-d474f4f09859] +description = "Complex exponential function -> Exponential resulting in a number with real and imaginary part" + +[06d793bf-73bd-4b02-b015-3030b2c952ec] +description = "Operations between real numbers and complex numbers -> Add real number to complex number" + +[d77dbbdf-b8df-43f6-a58d-3acb96765328] +description = "Operations between real numbers and complex numbers -> Add complex number to real number" + +[20432c8e-8960-4c40-ba83-c9d910ff0a0f] +description = "Operations between real numbers and complex numbers -> Subtract real number from complex number" + +[b4b38c85-e1bf-437d-b04d-49bba6e55000] +description = "Operations between real numbers and complex numbers -> Subtract complex number from real number" + +[dabe1c8c-b8f4-44dd-879d-37d77c4d06bd] +description = "Operations between real numbers and complex numbers -> Multiply complex number by real number" + +[6c81b8c8-9851-46f0-9de5-d96d314c3a28] +description = "Operations between real numbers and complex numbers -> Multiply real number by complex number" + +[8a400f75-710e-4d0c-bcb4-5e5a00c78aa0] +description = "Operations between real numbers and complex numbers -> Divide complex number by real number" + +[9a867d1b-d736-4c41-a41e-90bd148e9d5e] +description = "Operations between real numbers and complex numbers -> Divide real number by complex number" diff --git a/exercises/practice/complex-numbers/complex-numbers.test.ts b/exercises/practice/complex-numbers/complex-numbers.test.ts index 5096a011a..c350113e1 100644 --- a/exercises/practice/complex-numbers/complex-numbers.test.ts +++ b/exercises/practice/complex-numbers/complex-numbers.test.ts @@ -214,4 +214,76 @@ describe('Complex numbers', () => { expect(actual.real).toBeCloseTo(expected.real) expect(actual.imag).toBeCloseTo(expected.imag) }) + + xit('Exponential of a number with real and imaginary part', () => { + const expected = new ComplexNumber(-2, 0) + const actual = new ComplexNumber(Math.log(2), Math.PI).exp + + expect(actual.real).toBeCloseTo(expected.real) + expect(actual.imag).toBeCloseTo(expected.imag) + }) + + xit('Exponential resulting in a number with real and imaginary part', () => { + const expected = new ComplexNumber(1, 1) + const actual = new ComplexNumber(Math.log(2) / 2, Math.PI / 4).exp + + expect(actual.real).toBeCloseTo(expected.real) + expect(actual.imag).toBeCloseTo(expected.imag) + }) + + xit('Add real number to complex number', () => { + const expected = new ComplexNumber(6, 2) + const actual = new ComplexNumber(1, 2).add(new ComplexNumber(5, 0)) + + expect(actual).toEqual(expected) + }) + + xit('Add complex number to real number', () => { + const expected = new ComplexNumber(6, 2) + const actual = new ComplexNumber(5, 0).add(new ComplexNumber(1, 2)) + + expect(actual).toEqual(expected) + }) + + xit('Subtract real number from complex number', () => { + const expected = new ComplexNumber(1, 7) + const actual = new ComplexNumber(5, 7).sub(new ComplexNumber(4, 0)) + + expect(actual).toEqual(expected) + }) + + xit('Subtract complex number from real number', () => { + const expected = new ComplexNumber(-1, -7) + const actual = new ComplexNumber(4, 0).sub(new ComplexNumber(5, 7)) + + expect(actual).toEqual(expected) + }) + + xit('Multiply complex number by real number', () => { + const expected = new ComplexNumber(10, 25) + const actual = new ComplexNumber(2, 5).mul(new ComplexNumber(5, 0)) + + expect(actual).toEqual(expected) + }) + + xit('Multiply real number by complex number', () => { + const expected = new ComplexNumber(10, 25) + const actual = new ComplexNumber(5, 0).mul(new ComplexNumber(2, 5)) + + expect(actual).toEqual(expected) + }) + + xit('Divide complex number by real number', () => { + const expected = new ComplexNumber(1, 10) + const actual = new ComplexNumber(10, 100).div(new ComplexNumber(10, 0)) + + expect(actual).toEqual(expected) + }) + + xit('Divide real number by complex number', () => { + const expected = new ComplexNumber(2.5, -2.5) + const actual = new ComplexNumber(5, 0).div(new ComplexNumber(1, 1)) + + expect(actual).toEqual(expected) + }) }) diff --git a/exercises/practice/connect/.meta/tests.toml b/exercises/practice/connect/.meta/tests.toml index 59ec615e3..951b87e5c 100644 --- a/exercises/practice/connect/.meta/tests.toml +++ b/exercises/practice/connect/.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. [6eff0df4-3e92-478d-9b54-d3e8b354db56] description = "an empty board has no winner" @@ -23,6 +30,12 @@ description = "nobody wins crossing adjacent angles" [cd61c143-92f6-4a8d-84d9-cb2b359e226b] description = "X wins crossing from left to right" +[495e33ed-30a9-4012-b46e-d7c4d5fe13c3] +description = "X wins with left-hand dead end fork" + +[ab167ab0-4a98-4d0f-a1c0-e1cddddc3d58] +description = "X wins with right-hand dead end fork" + [73d1eda6-16ab-4460-9904-b5f5dd401d0b] description = "O wins crossing from top to bottom" diff --git a/exercises/practice/connect/connect.test.ts b/exercises/practice/connect/connect.test.ts index ef55639db..dfd3c09e7 100644 --- a/exercises/practice/connect/connect.test.ts +++ b/exercises/practice/connect/connect.test.ts @@ -61,6 +61,16 @@ describe('Judging a game of connect', () => { expect(new Board(board).winner()).toEqual('X') }) + xit('X wins with left-hand dead end fork', () => { + const board = ['. . X .', ' X X . .', ' . X X X', ' O O O O'] + expect(new Board(board).winner()).toEqual('X') + }) + + xit('X wins with right-hand dead end fork', () => { + const board = ['. . X X', ' X X . .', ' . X X .', ' O O O O'] + expect(new Board(board).winner()).toEqual('X') + }) + xit('O wins crossing from top to bottom', () => { const board = [ '. O . .', diff --git a/exercises/practice/custom-set/.meta/tests.toml b/exercises/practice/custom-set/.meta/tests.toml index 6ba623159..430c139e6 100644 --- a/exercises/practice/custom-set/.meta/tests.toml +++ b/exercises/practice/custom-set/.meta/tests.toml @@ -1,117 +1,130 @@ -# 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. [20c5f855-f83a-44a7-abdd-fe75c6cf022b] -description = "sets with no elements are empty" +description = "Returns true if the set contains no elements -> sets with no elements are empty" [d506485d-5706-40db-b7d8-5ceb5acf88d2] -description = "sets with elements are not empty" +description = "Returns true if the set contains no elements -> sets with elements are not empty" [759b9740-3417-44c3-8ca3-262b3c281043] -description = "nothing is contained in an empty set" +description = "Sets can report if they contain an element -> nothing is contained in an empty set" [f83cd2d1-2a85-41bc-b6be-80adbff4be49] -description = "when the element is in the set" +description = "Sets can report if they contain an element -> when the element is in the set" [93423fc0-44d0-4bc0-a2ac-376de8d7af34] -description = "when the element is not in the set" +description = "Sets can report if they contain an element -> when the element is not in the set" [c392923a-637b-4495-b28e-34742cd6157a] -description = "empty set is a subset of another empty set" +description = "A set is a subset if all of its elements are contained in the other set -> empty set is a subset of another empty set" [5635b113-be8c-4c6f-b9a9-23c485193917] -description = "empty set is a subset of non-empty set" +description = "A set is a subset if all of its elements are contained in the other set -> empty set is a subset of non-empty set" [832eda58-6d6e-44e2-92c2-be8cf0173cee] -description = "non-empty set is not a subset of empty set" +description = "A set is a subset if all of its elements are contained in the other set -> non-empty set is not a subset of empty set" [c830c578-8f97-4036-b082-89feda876131] -description = "set is a subset of set with exact same elements" +description = "A set is a subset if all of its elements are contained in the other set -> set is a subset of set with exact same elements" [476a4a1c-0fd1-430f-aa65-5b70cbc810c5] -description = "set is a subset of larger set with same elements" +description = "A set is a subset if all of its elements are contained in the other set -> set is a subset of larger set with same elements" [d2498999-3e46-48e4-9660-1e20c3329d3d] -description = "set is not a subset of set that does not contain its elements" +description = "A set is a subset if all of its elements are contained in the other set -> set is not a subset of set that does not contain its elements" [7d38155e-f472-4a7e-9ad8-5c1f8f95e4cc] -description = "the empty set is disjoint with itself" +description = "Sets are disjoint if they share no elements -> the empty set is disjoint with itself" [7a2b3938-64b6-4b32-901a-fe16891998a6] -description = "empty set is disjoint with non-empty set" +description = "Sets are disjoint if they share no elements -> empty set is disjoint with non-empty set" [589574a0-8b48-48ea-88b0-b652c5fe476f] -description = "non-empty set is disjoint with empty set" +description = "Sets are disjoint if they share no elements -> non-empty set is disjoint with empty set" [febeaf4f-f180-4499-91fa-59165955a523] -description = "sets are not disjoint if they share an element" +description = "Sets are disjoint if they share no elements -> sets are not disjoint if they share an element" [0de20d2f-c952-468a-88c8-5e056740f020] -description = "sets are disjoint if they share no elements" +description = "Sets are disjoint if they share no elements -> sets are disjoint if they share no elements" [4bd24adb-45da-4320-9ff6-38c044e9dff8] -description = "empty sets are equal" +description = "Sets with the same elements are equal -> empty sets are equal" [f65c0a0e-6632-4b2d-b82c-b7c6da2ec224] -description = "empty set is not equal to non-empty set" +description = "Sets with the same elements are equal -> empty set is not equal to non-empty set" [81e53307-7683-4b1e-a30c-7e49155fe3ca] -description = "non-empty set is not equal to empty set" +description = "Sets with the same elements are equal -> non-empty set is not equal to empty set" [d57c5d7c-a7f3-48cc-a162-6b488c0fbbd0] -description = "sets with the same elements are equal" +description = "Sets with the same elements are equal -> sets with the same elements are equal" [dd61bafc-6653-42cc-961a-ab071ee0ee85] -description = "sets with different elements are not equal" +description = "Sets with the same elements are equal -> sets with different elements are not equal" [06059caf-9bf4-425e-aaff-88966cb3ea14] -description = "set is not equal to larger set with same elements" +description = "Sets with the same elements are equal -> set is not equal to larger set with same elements" + +[d4a1142f-09aa-4df9-8b83-4437dcf7ec24] +description = "Sets with the same elements are equal -> set is equal to a set constructed from an array with duplicates" [8a677c3c-a658-4d39-bb88-5b5b1a9659f4] -description = "add to empty set" +description = "Unique elements can be added to a set -> add to empty set" [0903dd45-904d-4cf2-bddd-0905e1a8d125] -description = "add to non-empty set" +description = "Unique elements can be added to a set -> add to non-empty set" [b0eb7bb7-5e5d-4733-b582-af771476cb99] -description = "adding an existing element does not change the set" +description = "Unique elements can be added to a set -> adding an existing element does not change the set" [893d5333-33b8-4151-a3d4-8f273358208a] -description = "intersection of two empty sets is an empty set" +description = "Intersection returns a set of all shared elements -> intersection of two empty sets is an empty set" [d739940e-def2-41ab-a7bb-aaf60f7d782c] -description = "intersection of an empty set and non-empty set is an empty set" +description = "Intersection returns a set of all shared elements -> intersection of an empty set and non-empty set is an empty set" [3607d9d8-c895-4d6f-ac16-a14956e0a4b7] -description = "intersection of a non-empty set and an empty set is an empty set" +description = "Intersection returns a set of all shared elements -> intersection of a non-empty set and an empty set is an empty set" [b5120abf-5b5e-41ab-aede-4de2ad85c34e] -description = "intersection of two sets with no shared elements is an empty set" +description = "Intersection returns a set of all shared elements -> intersection of two sets with no shared elements is an empty set" [af21ca1b-fac9-499c-81c0-92a591653d49] -description = "intersection of two sets with shared elements is a set of the shared elements" +description = "Intersection returns a set of all shared elements -> intersection of two sets with shared elements is a set of the shared elements" [c5e6e2e4-50e9-4bc2-b89f-c518f015b57e] -description = "difference of two empty sets is an empty set" +description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference of two empty sets is an empty set" [2024cc92-5c26-44ed-aafd-e6ca27d6fcd2] -description = "difference of empty set and non-empty set is an empty set" +description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference of empty set and non-empty set is an empty set" [e79edee7-08aa-4c19-9382-f6820974b43e] -description = "difference of a non-empty set and an empty set is the non-empty set" +description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference of a non-empty set and an empty set is the non-empty set" [c5ac673e-d707-4db5-8d69-7082c3a5437e] -description = "difference of two non-empty sets is a set of elements that are only in the first set" +description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference of two non-empty sets is a set of elements that are only in the first set" + +[20d0a38f-7bb7-4c4a-ac15-90c7392ecf2b] +description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference removes all duplicates in the first set" [c45aed16-5494-455a-9033-5d4c93589dc6] -description = "union of empty sets is an empty set" +description = "Union returns a set of all elements in either set -> union of empty sets is an empty set" [9d258545-33c2-4fcb-a340-9f8aa69e7a41] -description = "union of an empty set and non-empty set is the non-empty set" +description = "Union returns a set of all elements in either set -> union of an empty set and non-empty set is the non-empty set" [3aade50c-80c7-4db8-853d-75bac5818b83] -description = "union of a non-empty set and empty set is the non-empty set" +description = "Union returns a set of all elements in either set -> union of a non-empty set and empty set is the non-empty set" [a00bb91f-c4b4-4844-8f77-c73e2e9df77c] -description = "union of non-empty sets contains all unique elements" +description = "Union returns a set of all elements in either set -> union of non-empty sets contains all unique elements" diff --git a/exercises/practice/custom-set/custom-set.test.ts b/exercises/practice/custom-set/custom-set.test.ts index a3ecdebf9..639101752 100644 --- a/exercises/practice/custom-set/custom-set.test.ts +++ b/exercises/practice/custom-set/custom-set.test.ts @@ -117,6 +117,16 @@ describe('CustomSet', () => { const actual = new CustomSet([1, 2, 3]).eql(new CustomSet([1, 2, 4])) expect(actual).toBeFalsy() }) + + xit('set is not equal to larger set with same elements', () => { + const actual = new CustomSet([1, 2, 3]).eql(new CustomSet([1, 2, 3, 4])) + expect(actual).toBeFalsy() + }) + + xit('set is equal to a set constructed from an array with duplicates', () => { + const actual = new CustomSet([1]).eql(new CustomSet([1, 1])) + expect(actual).toBeTruthy() + }) }) xdescribe('add: unique elements can be added to a set', () => { @@ -199,6 +209,12 @@ describe('CustomSet', () => { const expected = new CustomSet([1, 3]) expect(actual.eql(expected)).toBeTruthy() }) + + xit('difference removes all duplicates in the first set', () => { + const actual = new CustomSet([1, 1]).difference(new CustomSet([1])) + const expected = new CustomSet() + expect(actual.eql(expected)).toBeTruthy() + }) }) xdescribe('union: returns a set of all elements in either set', () => { diff --git a/exercises/practice/dnd-character/.meta/tests.toml b/exercises/practice/dnd-character/.meta/tests.toml index eedfb2c4c..719043b25 100644 --- a/exercises/practice/dnd-character/.meta/tests.toml +++ b/exercises/practice/dnd-character/.meta/tests.toml @@ -1,76 +1,72 @@ +# 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. + [1e9ae1dc-35bd-43ba-aa08-e4b94c20fa37] -description = "Ability modifier for score 3 is -4" -include = true +description = "ability modifier -> ability modifier for score 3 is -4" [cc9bb24e-56b8-4e9e-989d-a0d1a29ebb9c] -description = "Ability modifier for score 4 is -3" -include = true +description = "ability modifier -> ability modifier for score 4 is -3" [5b519fcd-6946-41ee-91fe-34b4f9808326] -description = "Ability modifier for score 5 is -3" -include = true +description = "ability modifier -> ability modifier for score 5 is -3" [dc2913bd-6d7a-402e-b1e2-6d568b1cbe21] -description = "Ability modifier for score 6 is -2" -include = true +description = "ability modifier -> ability modifier for score 6 is -2" [099440f5-0d66-4b1a-8a10-8f3a03cc499f] -description = "Ability modifier for score 7 is -2" -include = true +description = "ability modifier -> ability modifier for score 7 is -2" [cfda6e5c-3489-42f0-b22b-4acb47084df0] -description = "Ability modifier for score 8 is -1" -include = true +description = "ability modifier -> ability modifier for score 8 is -1" [c70f0507-fa7e-4228-8463-858bfbba1754] -description = "Ability modifier for score 9 is -1" -include = true +description = "ability modifier -> ability modifier for score 9 is -1" [6f4e6c88-1cd9-46a0-92b8-db4a99b372f7] -description = "Ability modifier for score 10 is 0" -include = true +description = "ability modifier -> ability modifier for score 10 is 0" [e00d9e5c-63c8-413f-879d-cd9be9697097] -description = "Ability modifier for score 11 is 0" -include = true +description = "ability modifier -> ability modifier for score 11 is 0" [eea06f3c-8de0-45e7-9d9d-b8cab4179715] -description = "Ability modifier for score 12 is 1" -include = true +description = "ability modifier -> ability modifier for score 12 is +1" [9c51f6be-db72-4af7-92ac-b293a02c0dcd] -description = "Ability modifier for score 13 is 1" -include = true +description = "ability modifier -> ability modifier for score 13 is +1" [94053a5d-53b6-4efc-b669-a8b5098f7762] -description = "Ability modifier for score 14 is 2" -include = true +description = "ability modifier -> ability modifier for score 14 is +2" [8c33e7ca-3f9f-4820-8ab3-65f2c9e2f0e2] -description = "Ability modifier for score 15 is 2" -include = true +description = "ability modifier -> ability modifier for score 15 is +2" [c3ec871e-1791-44d0-b3cc-77e5fb4cd33d] -description = "Ability modifier for score 16 is 3" -include = true +description = "ability modifier -> ability modifier for score 16 is +3" [3d053cee-2888-4616-b9fd-602a3b1efff4] -description = "Ability modifier for score 17 is 3" -include = true +description = "ability modifier -> ability modifier for score 17 is +3" [bafd997a-e852-4e56-9f65-14b60261faee] -description = "Ability modifier for score 18 is 4" -include = true +description = "ability modifier -> ability modifier for score 18 is +4" [4f28f19c-2e47-4453-a46a-c0d365259c14] -description = "Random ability is within range" -include = true +description = "random ability is within range" [385d7e72-864f-4e88-8279-81a7d75b04ad] -description = "Random character is valid" -include = true +description = "random character is valid" [2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe] -description = "Each ability is only calculated once" -include = true +description = "each ability is only calculated once" +include = false +[dca2b2ec-f729-4551-84b9-078876bb4808] +description = "each ability is only calculated once" +reimplements = "2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe" diff --git a/exercises/practice/dnd-character/dnd-character.test.ts b/exercises/practice/dnd-character/dnd-character.test.ts index 91132c50b..267eee213 100644 --- a/exercises/practice/dnd-character/dnd-character.test.ts +++ b/exercises/practice/dnd-character/dnd-character.test.ts @@ -130,5 +130,10 @@ describe('Character creation', () => { const character = new DnDCharacter() expect(character.strength === character.strength).toBeTruthy() + expect(character.dexterity === character.dexterity).toBeTruthy() + expect(character.constitution === character.constitution).toBeTruthy() + expect(character.intelligence === character.intelligence).toBeTruthy() + expect(character.wisdom === character.wisdom).toBeTruthy() + expect(character.charisma === character.charisma).toBeTruthy() }) }) diff --git a/exercises/practice/isogram/.meta/config.json b/exercises/practice/isogram/.meta/config.json index 55d906c74..ac0fa9a9b 100644 --- a/exercises/practice/isogram/.meta/config.json +++ b/exercises/practice/isogram/.meta/config.json @@ -25,7 +25,7 @@ "flag.tests.includes-optional": false, "flag.tests.jest": true, "flag.tests.tstyche": false - } + }, "source": "Wikipedia", "source_url": "https://en.wikipedia.org/wiki/Isogram" } diff --git a/exercises/practice/line-up/.meta/tests.toml b/exercises/practice/line-up/.meta/tests.toml index 36fdf1d0c..dd66fc158 100644 --- a/exercises/practice/line-up/.meta/tests.toml +++ b/exercises/practice/line-up/.meta/tests.toml @@ -51,9 +51,24 @@ description = "format non-exceptional ordinal numeral 13" [2bdcebc5-c029-4874-b6cc-e9bec80d603a] description = "format exceptional ordinal numeral 21" +[a98e2e22-ab41-4557-a7c2-efedc19c16da] +description = "format exceptional ordinal numeral 22 ending in nd even though it is a multiple of 11" + +[ab45d2fb-e0ee-4016-b605-76917584db0a] +description = "format exceptional ordinal numeral 33 ending in rd even though it is a multiple of 11" + +[c9243603-9f17-45b3-9a41-db9ebdbf08e1] +description = "format exceptional ordinal numeral 52 ending in nd even though it is a multiple of 13" + [74ee2317-0295-49d2-baf0-d56bcefa14e3] description = "format exceptional ordinal numeral 62" +[3f6c408c-4331-42b6-bb6c-3ad0823e568a] +description = "format non-exceptional ordinal numeral 72 ending in nd even though it is a multiple of 12" + +[8db52cd9-9689-413f-a812-6c36fcfd0d07] +description = "format exceptional ordinal numeral 91 ending in st even though it is a multiple of 13" + [b37c332d-7f68-40e3-8503-e43cbd67a0c4] description = "format exceptional ordinal numeral 100" @@ -65,3 +80,6 @@ description = "format non-exceptional ordinal numeral 112" [06b62efe-199e-4ce7-970d-4bf73945713f] description = "format exceptional ordinal numeral 123" + +[6792c54e-59a7-4faf-839a-c4bb61014229] +description = "format large number 972 ending in nd even though it is a multiple of 12" diff --git a/exercises/practice/line-up/line-up.test.ts b/exercises/practice/line-up/line-up.test.ts index 8baf50da9..940b0532a 100644 --- a/exercises/practice/line-up/line-up.test.ts +++ b/exercises/practice/line-up/line-up.test.ts @@ -86,12 +86,42 @@ describe('Line Up', () => { ) }) + xit('format exceptional ordinal numeral 22 ending in nd even though it is a multiple of 11', () => { + expect(format('Ingrid', 22)).toBe( + 'Ingrid, you are the 22nd customer we serve today. Thank you!' + ) + }) + + xit('format exceptional ordinal numeral 33 ending in rd even though it is a multiple of 11', () => { + expect(format('Mario', 33)).toBe( + 'Mario, you are the 33rd customer we serve today. Thank you!' + ) + }) + + xit('format exceptional ordinal numeral 52 ending in nd even though it is a multiple of 13', () => { + expect(format('Quentin', 52)).toBe( + 'Quentin, you are the 52nd customer we serve today. Thank you!' + ) + }) + xit('format exceptional ordinal numeral 62', () => { expect(format('Nayra', 62)).toBe( 'Nayra, you are the 62nd customer we serve today. Thank you!' ) }) + xit('format non-exceptional ordinal numeral 72 ending in nd even though it is a multiple of 12', () => { + expect(format('Ugo', 72)).toBe( + 'Ugo, you are the 72nd customer we serve today. Thank you!' + ) + }) + + xit('format exceptional ordinal numeral 91 ending in st even though it is a multiple of 13', () => { + expect(format('Boris', 91)).toBe( + 'Boris, you are the 91st customer we serve today. Thank you!' + ) + }) + xit('format exceptional ordinal numeral 100', () => { expect(format('John', 100)).toBe( 'John, you are the 100th customer we serve today. Thank you!' @@ -104,7 +134,7 @@ describe('Line Up', () => { ) }) - xit('format exceptional ordinal numeral 112', () => { + xit('format non-exceptional ordinal numeral 112', () => { expect(format('Knud', 112)).toBe( 'Knud, you are the 112th customer we serve today. Thank you!' ) @@ -115,4 +145,10 @@ describe('Line Up', () => { 'Yma, you are the 123rd customer we serve today. Thank you!' ) }) + + xit('format large number 972 ending in nd even though it is a multiple of 12', () => { + expect(format('Elias', 972)).toBe( + 'Elias, you are the 972nd customer we serve today. Thank you!' + ) + }) }) diff --git a/exercises/practice/pangram/.meta/config.json b/exercises/practice/pangram/.meta/config.json index b64c1a8bd..9c2e18fdb 100644 --- a/exercises/practice/pangram/.meta/config.json +++ b/exercises/practice/pangram/.meta/config.json @@ -27,7 +27,7 @@ "flag.tests.includes-optional": false, "flag.tests.jest": true, "flag.tests.tstyche": false - } + }, "source": "Wikipedia", "source_url": "https://en.wikipedia.org/wiki/Pangram" } diff --git a/exercises/practice/prism/.meta/config.json b/exercises/practice/prism/.meta/config.json index ce1d449ac..f5f77b8b0 100644 --- a/exercises/practice/prism/.meta/config.json +++ b/exercises/practice/prism/.meta/config.json @@ -21,7 +21,7 @@ "flag.tests.includes-optional": false, "flag.tests.jest": true, "flag.tests.tstyche": false - } + }, "source": "FraSanga", "source_url": "https://github.com/exercism/problem-specifications/pull/2625" } diff --git a/exercises/practice/state-of-tic-tac-toe/.meta/proof.ci.ts b/exercises/practice/state-of-tic-tac-toe/.meta/proof.ci.ts index d4d8f1ec9..cd7d98caa 100644 --- a/exercises/practice/state-of-tic-tac-toe/.meta/proof.ci.ts +++ b/exercises/practice/state-of-tic-tac-toe/.meta/proof.ci.ts @@ -36,7 +36,7 @@ export const gamestate = (board: string[]): string => { const xWins = scoringArray.some((score) => score === gridSize) const oWins = scoringArray.some((score) => score === -gridSize) - if (xWins && oWins) { + if ((xWins && numberOfX === numberOfO) || (oWins && numberOfX > numberOfO)) { throw new Error( 'Impossible board: game should have ended after the game was won' ) diff --git a/exercises/practice/state-of-tic-tac-toe/.meta/tests.toml b/exercises/practice/state-of-tic-tac-toe/.meta/tests.toml index 8fc25e211..5f574b2a1 100644 --- a/exercises/practice/state-of-tic-tac-toe/.meta/tests.toml +++ b/exercises/practice/state-of-tic-tac-toe/.meta/tests.toml @@ -99,3 +99,9 @@ reimplements = "b1dc8b13-46c4-47db-a96d-aa90eedc4e8d" [4801cda2-f5b7-4c36-8317-3cdd167ac22c] description = "Invalid boards -> Invalid board: players kept playing after a win" + +[5a84757a-fc86-4328-aec9-a5759e6ed35d] +description = "Invalid boards -> Invalid board: O kept playing after X wins" + +[cf25543d-583a-4656-b9ab-f82dc00a4a02] +description = "Invalid boards -> Invalid board: X kept playing after O wins" diff --git a/exercises/practice/state-of-tic-tac-toe/state-of-tic-tac-toe.test.ts b/exercises/practice/state-of-tic-tac-toe/state-of-tic-tac-toe.test.ts index c5e5b9ab7..1e23139d6 100644 --- a/exercises/practice/state-of-tic-tac-toe/state-of-tic-tac-toe.test.ts +++ b/exercises/practice/state-of-tic-tac-toe/state-of-tic-tac-toe.test.ts @@ -155,5 +155,23 @@ describe('state-of-tic-tac-toe', () => { 'Impossible board: game should have ended after the game was won' ) }) + + xit('Invalid board: O kept playing after X wins', () => { + const board = ['OO ', 'XXX', ' O '] + expect(() => { + gamestate(board) + }).toThrow( + 'Impossible board: game should have ended after the game was won' + ) + }) + + xit('Invalid board: X kept playing after O wins', () => { + const board = ['XX ', 'OOO', ' XX'] + expect(() => { + gamestate(board) + }).toThrow( + 'Impossible board: game should have ended after the game was won' + ) + }) }) })