diff --git a/exercises/practice/anagram/.meta/tests.toml b/exercises/practice/anagram/.meta/tests.toml index 8a3708bb..4f43811d 100644 --- a/exercises/practice/anagram/.meta/tests.toml +++ b/exercises/practice/anagram/.meta/tests.toml @@ -46,6 +46,11 @@ description = "detects anagrams using case-insensitive possible matches" [7cc195ad-e3c7-44ee-9fd2-d3c344806a2c] description = "does not detect an anagram if the original word is repeated" +include = false + +[630abb71-a94e-4715-8395-179ec1df9f91] +description = "does not detect an anagram if the original word is repeated" +reimplements = "7cc195ad-e3c7-44ee-9fd2-d3c344806a2c" [9878a1c9-d6ea-4235-ae51-3ea2befd6842] description = "anagrams must use all letters exactly once" diff --git a/exercises/practice/anagram/anagram.test b/exercises/practice/anagram/anagram.test index 56227155..c131bc21 100644 --- a/exercises/practice/anagram/anagram.test +++ b/exercises/practice/anagram/anagram.test @@ -57,7 +57,7 @@ test anagram-10 "detects anagrams using case-insensitive possible matches" -body skip anagram-11 test anagram-11 "does not detect an anagram if the original word is repeated" -body { - findAnagrams go {go Go GO} + findAnagrams go {goGoGO} } -returnCodes ok -result {} skip anagram-12 diff --git a/exercises/practice/bank-account/.meta/tests.toml b/exercises/practice/bank-account/.meta/tests.toml new file mode 100644 index 00000000..4e42d4dc --- /dev/null +++ b/exercises/practice/bank-account/.meta/tests.toml @@ -0,0 +1,61 @@ +# 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. + +[983a1528-4ceb-45e5-8257-8ce01aceb5ed] +description = "Newly opened account has zero balance" + +[e88d4ec3-c6bf-4752-8e59-5046c44e3ba7] +description = "Single deposit" + +[3d9147d4-63f4-4844-8d2b-1fee2e9a2a0d] +description = "Multiple deposits" + +[08f1af07-27ae-4b38-aa19-770bde558064] +description = "Withdraw once" + +[6f6d242f-8c31-4ac6-8995-a90d42cad59f] +description = "Withdraw twice" + +[45161c94-a094-4c77-9cec-998b70429bda] +description = "Can do multiple operations sequentially" + +[f9facfaa-d824-486e-8381-48832c4bbffd] +description = "Cannot check balance of closed account" + +[7a65ba52-e35c-4fd2-8159-bda2bde6e59c] +description = "Cannot deposit into closed account" + +[a0a1835d-faae-4ad4-a6f3-1fcc2121380b] +description = "Cannot deposit into unopened account" + +[570dfaa5-0532-4c1f-a7d3-0f65c3265608] +description = "Cannot withdraw from closed account" + +[c396d233-1c49-4272-98dc-7f502dbb9470] +description = "Cannot close an account that was not opened" + +[c06f534f-bdc2-4a02-a388-1063400684de] +description = "Cannot open an already opened account" + +[0722d404-6116-4f92-ba3b-da7f88f1669c] +description = "Reopened account does not retain balance" + +[ec42245f-9361-4341-8231-a22e8d19c52f] +description = "Cannot withdraw more than deposited" + +[4f381ef8-10ef-4507-8e1d-0631ecc8ee72] +description = "Cannot withdraw negative" + +[d45df9ea-1db0-47f3-b18c-d365db49d938] +description = "Cannot deposit negative" + +[ba0c1e0b-0f00-416f-8097-a7dfc97871ff] +description = "Can handle concurrent transactions" diff --git a/exercises/practice/bank-account/bank-account.test b/exercises/practice/bank-account/bank-account.test index d8430196..c23fa5ff 100644 --- a/exercises/practice/bank-account/bank-account.test +++ b/exercises/practice/bank-account/bank-account.test @@ -15,7 +15,7 @@ test bank-account-1 "newly opened account has zero balance" -body { } -returnCodes ok -result 0 skip bank-account-2 -test bank-account-2 "can deposit money" -body { +test bank-account-2 "single deposit" -body { set account [BankAccount new] $account open $account deposit 100 @@ -23,7 +23,7 @@ test bank-account-2 "can deposit money" -body { } -returnCodes ok -result 100 skip bank-account-3 -test bank-account-3 "can deposit money sequentially" -body { +test bank-account-3 "multiple deposits" -body { set account [BankAccount new] $account open $account deposit 100 @@ -32,63 +32,81 @@ test bank-account-3 "can deposit money sequentially" -body { } -returnCodes ok -result 150 skip bank-account-4 -test bank-account-4 "can withdraw money" -body { +test bank-account-4 "withdraw once" -body { set account [BankAccount new] $account open $account deposit 100 - $account withdraw 50 + $account withdraw 75 $account balance -} -returnCodes ok -result 50 +} -returnCodes ok -result 25 skip bank-account-5 -test bank-account-5 "can withdraw money sequentially" -body { +test bank-account-5 "withdraw twice" -body { set account [BankAccount new] $account open $account deposit 100 - $account withdraw 20 $account withdraw 80 + $account withdraw 20 $account balance } -returnCodes ok -result 0 skip bank-account-6 -test bank-account-6 "checking balance of closed account throws error" -body { +test bank-account-6 "can do multiple operations sequentially" -body { + set account [BankAccount new] + $account open + $account deposit 100 + $account deposit 110 + $account withdraw 200 + $account deposit 60 + $account withdraw 50 + $account balance +} -returnCodes ok -result 20 + +skip bank-account-7 +test bank-account-7 "cannot check balance of a closed account" -body { set account [BankAccount new] $account open $account close $account balance } -returnCodes error -match glob -result "*account is not open*" -skip bank-account-7 -test bank-account-7 "deposit into closed account" -body { +skip bank-account-8 +test bank-account-8 "cannot deposit into closed account" -body { set account [BankAccount new] $account open $account close $account deposit 50 } -returnCodes error -match glob -result "*account is not open*" -skip bank-account-8 -test bank-account-8 "withdraw from closed account" -body { +skip bank-account-9 +test bank-account-9 "cannot deposit into unopened account" -body { + set account [BankAccount new] + $account deposit 50 +} -returnCodes error -match glob -result "*account is not open*" + +skip bank-account-10 +test bank-account-10 "cannot withdraw from closed account" -body { set account [BankAccount new] $account open $account close $account withdraw 50 } -returnCodes error -match glob -result "*account is not open*" -skip bank-account-9 -test bank-account-9 "close already closed account" -body { +skip bank-account-11 +test bank-account-11 "cannot close an account that was not opened" -body { set account [BankAccount new] $account close } -returnCodes error -match glob -result "*account is not open*" -skip bank-account-10 -test bank-account-10 "open already opened account" -body { +skip bank-account-12 +test bank-account-12 "cannot open an already opened account" -body { set account [BankAccount new] $account open $account open } -returnCodes error -match glob -result "*account is already open*" -skip bank-account-11 -test bank-account-11 "reopened account does not retain balance" -body { +skip bank-account-13 +test bank-account-13 "reopened account does not retain balance" -body { set account [BankAccount new] $account open $account deposit 50 @@ -97,31 +115,31 @@ test bank-account-11 "reopened account does not retain balance" -body { $account balance } -returnCodes ok -result 0 -skip bank-account-12 -test bank-account-12 "cannot withdraw more than deposited" -body { +skip bank-account-14 +test bank-account-14 "cannot withdraw more than deposited" -body { set account [BankAccount new] $account open $account deposit 25 $account withdraw 50 } -returnCodes error -match glob -result "*insufficient funds*" -skip bank-account-13 -test bank-account-13 "cannot withdraw negative" -body { +skip bank-account-15 +test bank-account-15 "cannot withdraw negative" -body { set account [BankAccount new] $account open $account deposit 100 $account withdraw -50 } -returnCodes error -match glob -result "*invalid amount*" -skip bank-account-14 -test bank-account-14 "cannot deposit negative" -body { +skip bank-account-16 +test bank-account-16 "cannot deposit negative" -body { set account [BankAccount new] $account open $account deposit -50 } -returnCodes error -match glob -result "*invalid amount*" -skip bank-account-15 -test bank-account-15 "adjust balance concurrently" -body { +skip bank-account-17 +test bank-account-17 "can handle concurrent transactions" -body { # In this style of using Tcl threads, we don't need # to make any thread-specific adjustments to the # BankAccount class: passing messages between threads diff --git a/exercises/practice/custom-set/.meta/tests.toml b/exercises/practice/custom-set/.meta/tests.toml index 6ba62315..8c450e0b 100644 --- a/exercises/practice/custom-set/.meta/tests.toml +++ b/exercises/practice/custom-set/.meta/tests.toml @@ -1,117 +1,127 @@ -# 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" [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 b/exercises/practice/custom-set/custom-set.test index b368d152..31ac7663 100644 --- a/exercises/practice/custom-set/custom-set.test +++ b/exercises/practice/custom-set/custom-set.test @@ -188,6 +188,13 @@ test set-5.6 "set is not equal to larger set with same elements" -body { $s1 equals $s2 } -returnCodes ok -match boolean -result false +skip set-5.7 +test set-5.7 "set is equal to a set constructed from an array with duplicates" -body { + set s1 [Set new {1}] + set s2 [Set new {1 1}] + $s1 equals $s2 +} -returnCodes ok -match boolean -result true + # Unique elements can be added to a set skip set-6.1 test set-6.1 "add to empty set" -body {