diff --git a/exercises/practice/isbn-verifier/.meta/tests.toml b/exercises/practice/isbn-verifier/.meta/tests.toml index 6d5a845..17e18d4 100644 --- a/exercises/practice/isbn-verifier/.meta/tests.toml +++ b/exercises/practice/isbn-verifier/.meta/tests.toml @@ -30,6 +30,12 @@ description = "invalid character in isbn is not treated as zero" [28025280-2c39-4092-9719-f3234b89c627] description = "X is only valid as a check digit" +[8005b57f-f194-44ee-88d2-a77ac4142591] +description = "only one check digit is allowed" + +[fdb14c99-4cf8-43c5-b06d-eb1638eff343] +description = "X is not substituted by the value 10" + [f6294e61-7e79-46b3-977b-f48789a4945b] description = "valid isbn without separating dashes" diff --git a/exercises/practice/isbn-verifier/test/src/Main.idr b/exercises/practice/isbn-verifier/test/src/Main.idr index 44b4f88..3625a3c 100644 --- a/exercises/practice/isbn-verifier/test/src/Main.idr +++ b/exercises/practice/isbn-verifier/test/src/Main.idr @@ -15,6 +15,8 @@ tests = , test "invalid check digit in isbn is not treated as zero" (assert $ not $ isValid "4-598-21507-B") , test "invalid character in isbn is not treated as zero" (assert $ not $ isValid "3-598-P1581-X") , test "X is only valid as a check digit" (assert $ not $ isValid "3-598-2X507-9") + , test "only one check digit is allowed" (assert $ not $ isValid "3-598-21508-96") + , test "X is not substituted by the value 10" (assert $ not $ isValid "3-598-2X507-5") , test "valid isbn without separating dashes" (assert $ isValid "3598215088") , test "isbn without separating dashes and X as check digit" (assert $ isValid "359821507X") , test "isbn without check digit and dashes" (assert $ not $ isValid "359821507") diff --git a/exercises/practice/line-up/.docs/instructions.md b/exercises/practice/line-up/.docs/instructions.md index fb41d4c..9e686ec 100644 --- a/exercises/practice/line-up/.docs/instructions.md +++ b/exercises/practice/line-up/.docs/instructions.md @@ -5,9 +5,9 @@ Yaʻqūb expects to use numbers from 1 up to 999. Rules: -- Numbers ending in 1 (except for 11) → `"st"` -- Numbers ending in 2 (except for 12) → `"nd"` -- Numbers ending in 3 (except for 13) → `"rd"` +- Numbers ending in 1 (unless ending in 11) → `"st"` +- Numbers ending in 2 (unless ending in 12) → `"nd"` +- Numbers ending in 3 (unless ending in 13) → `"rd"` - All other numbers → `"th"` Examples: diff --git a/exercises/practice/satellite/.meta/tests.toml b/exercises/practice/satellite/.meta/tests.toml index b32dc3b..d0ed5b6 100644 --- a/exercises/practice/satellite/.meta/tests.toml +++ b/exercises/practice/satellite/.meta/tests.toml @@ -26,3 +26,12 @@ description = "Reject inconsistent traversals of same length" [d86a3d72-76a9-43b5-9d3a-e64cb1216035] description = "Reject traversals with repeated items" + +[af31ae02-7e5b-4452-a990-bccb3fca9148] +description = "A degenerate binary tree" + +[ee54463d-a719-4aae-ade4-190d30ce7320] +description = "Another degenerate binary tree" + +[87123c08-c155-4486-90a4-e2f75b0f3e8f] +description = "Tree with many more items" diff --git a/exercises/practice/satellite/test/src/Main.idr b/exercises/practice/satellite/test/src/Main.idr index f94189f..44bb4c4 100644 --- a/exercises/practice/satellite/test/src/Main.idr +++ b/exercises/practice/satellite/test/src/Main.idr @@ -25,6 +25,9 @@ tests = , test "Reject traversals of different length" (assertEq (treeFromTraversals ['a', 'b'] ['b', 'a', 'r']) $ Nothing) , test "Reject inconsistent traversals of same length" (assertEq (treeFromTraversals ['x', 'y', 'z'] ['a', 'b', 'c']) $ Nothing) , test "Reject traversals with repeated items" (assertEq (treeFromTraversals ['a', 'b', 'a'] ['b', 'a', 'a']) $ Nothing) + , test "A degenerate binary tree" (assertEq (treeFromTraversals ['a', 'b', 'c', 'd'] ['d', 'c', 'b', 'a']) $ Just (Branch (Branch (Branch (Branch Leaf 'd' Leaf) 'c' Leaf) 'b' Leaf) 'a' Leaf)) + , test "Another degenerate binary tree" (assertEq (treeFromTraversals ['a', 'b', 'c', 'd'] ['a', 'b', 'c', 'd']) $ Just (Branch Leaf 'a' (Branch Leaf 'b' (Branch Leaf 'c' (Branch Leaf 'd' Leaf))))) + , test "Tree with many more items" (assertEq (treeFromTraversals ['a', 'b', 'd', 'g', 'h', 'c', 'e', 'f', 'i'] ['g', 'd', 'h', 'b', 'a', 'e', 'c', 'i', 'f']) $ Just (Branch (Branch (Branch (Branch Leaf 'g' Leaf) 'd' (Branch Leaf 'h' Leaf)) 'b' Leaf) 'a' (Branch (Branch Leaf 'e' Leaf) 'c' (Branch (Branch Leaf 'i' Leaf) 'f' Leaf)))) ] export diff --git a/exercises/practice/triangle/.docs/instructions.md b/exercises/practice/triangle/.docs/instructions.md index ac39008..e9b053d 100644 --- a/exercises/practice/triangle/.docs/instructions.md +++ b/exercises/practice/triangle/.docs/instructions.md @@ -13,6 +13,12 @@ A _scalene_ triangle has all sides of different lengths. For a shape to be a triangle at all, all sides have to be of length > 0, and the sum of the lengths of any two sides must be greater than or equal to the length of the third side. +~~~~exercism/note +_Degenerate triangles_ are triangles where the sum of the length of two sides is **equal** to the length of the third side, e.g. `1, 1, 2`. +We opted to not include tests for degenerate triangles in this exercise. +You may handle those situations if you wish to do so, or safely ignore them. +~~~~ + In equations: Let `a`, `b`, and `c` be sides of the triangle.