Skip to content

Commit

Permalink
Add tests.toml file for all exercises with canonical data (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom authored Oct 10, 2020
1 parent 5d0ca83 commit 0a8a760
Show file tree
Hide file tree
Showing 8 changed files with 275 additions and 0 deletions.
43 changes: 43 additions & 0 deletions exercises/anagram/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[canonical-tests]

# no matches
"dd40c4d2-3c8b-44e5-992a-f42b393ec373" = true

# detects two anagrams
"b3cca662-f50a-489e-ae10-ab8290a09bdc" = true

# does not detect anagram subsets
"a27558ee-9ba0-4552-96b1-ecf665b06556" = true

# detects anagram
"64cd4584-fc15-4781-b633-3d814c4941a4" = true

# detects three anagrams
"99c91beb-838f-4ccd-b123-935139917283" = true

# detects multiple anagrams with different case
"78487770-e258-4e1f-a646-8ece10950d90" = true

# does not detect non-anagrams with identical checksum
"1d0ab8aa-362f-49b7-9902-3d0c668d557b" = true

# detects anagrams case-insensitively
"9e632c0b-c0b1-4804-8cc1-e295dea6d8a8" = true

# detects anagrams using case-insensitive subject
"b248e49f-0905-48d2-9c8d-bd02d8c3e392" = true

# detects anagrams using case-insensitive possible matches
"f367325c-78ec-411c-be76-e79047f4bd54" = true

# does not detect an anagram if the original word is repeated
"7cc195ad-e3c7-44ee-9fd2-d3c344806a2c" = true

# anagrams must use all letters exactly once
"9878a1c9-d6ea-4235-ae51-3ea2befd6842" = true

# words are not anagrams of themselves (case-insensitive)
"85757361-4535-45fd-ac0e-3810d40debc1" = true

# words other than themselves can be anagrams
"a0705568-628c-4b55-9798-82e4acde51ca" = true
28 changes: 28 additions & 0 deletions exercises/hamming/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[canonical-tests]

# empty strands
"f6dcb64f-03b0-4b60-81b1-3c9dbf47e887" = true

# single letter identical strands
"54681314-eee2-439a-9db0-b0636c656156" = true

# single letter different strands
"294479a3-a4c8-478f-8d63-6209815a827b" = true

# long identical strands
"9aed5f34-5693-4344-9b31-40c692fb5592" = true

# long different strands
"cd2273a5-c576-46c8-a52b-dee251c3e6e5" = true

# disallow first strand longer
"919f8ef0-b767-4d1b-8516-6379d07fcb28" = true

# disallow second strand longer
"8a2d4ed0-ead5-4fdd-924d-27c4cf56e60e" = true

# disallow left empty strand
"5dce058b-28d4-4ca7-aa64-adfe4e17784c" = true

# disallow right empty strand
"38826d4b-16fb-4639-ac3e-ba027dec8b5f" = true
46 changes: 46 additions & 0 deletions exercises/largest-series-product/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[canonical-tests]

# finds the largest product if span equals length
"7c82f8b7-e347-48ee-8a22-f672323324d4" = true

# can find the largest product of 2 with numbers in order
"88523f65-21ba-4458-a76a-b4aaf6e4cb5e" = true

# can find the largest product of 2
"f1376b48-1157-419d-92c2-1d7e36a70b8a" = true

# can find the largest product of 3 with numbers in order
"46356a67-7e02-489e-8fea-321c2fa7b4a4" = true

# can find the largest product of 3
"a2dcb54b-2b8f-4993-92dd-5ce56dece64a" = true

# can find the largest product of 5 with numbers in order
"673210a3-33cd-4708-940b-c482d7a88f9d" = true

# can get the largest product of a big number
"02acd5a6-3bbf-46df-8282-8b313a80a7c9" = true

# reports zero if the only digits are zero
"76dcc407-21e9-424c-a98e-609f269622b5" = true

# reports zero if all spans include zero
"6ef0df9f-52d4-4a5d-b210-f6fae5f20e19" = true

# rejects span longer than string length
"5d81aaf7-4f67-4125-bf33-11493cc7eab7" = true

# reports 1 for empty string and empty product (0 span)
"06bc8b90-0c51-4c54-ac22-3ec3893a079e" = true

# reports 1 for nonempty string and empty product (0 span)
"3ec0d92e-f2e2-4090-a380-70afee02f4c0" = true

# rejects empty string and nonzero span
"6d96c691-4374-4404-80ee-2ea8f3613dd4" = true

# rejects invalid character in digits
"7a38f2d6-3c35-45f6-8d6f-12e6e32d4d74" = true

# rejects negative span
"5fe3c0e5-a945-49f2-b584-f0814b4dd1ef" = true
28 changes: 28 additions & 0 deletions exercises/leap/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[canonical-tests]

# year not divisible by 4 in common year
"6466b30d-519c-438e-935d-388224ab5223" = true

# year divisible by 2, not divisible by 4 in common year
"ac227e82-ee82-4a09-9eb6-4f84331ffdb0" = true

# year divisible by 4, not divisible by 100 in leap year
"4fe9b84c-8e65-489e-970b-856d60b8b78e" = true

# year divisible by 4 and 5 is still a leap year
"7fc6aed7-e63c-48f5-ae05-5fe182f60a5d" = false

# year divisible by 100, not divisible by 400 in common year
"78a7848f-9667-4192-ae53-87b30c9a02dd" = true

# year divisible by 100 but not by 3 is still not a leap year
"9d70f938-537c-40a6-ba19-f50739ce8bac" = false

# year divisible by 400 in leap year
"42ee56ad-d3e6-48f1-8e3f-c84078d916fc" = true

# year divisible by 400 but not by 125 is still a leap year
"57902c77-6fe9-40de-8302-587b5c27121e" = false

# year divisible by 200, not divisible by 400 in common year
"c30331f6-f9f6-4881-ad38-8ca8c12520c1" = true
52 changes: 52 additions & 0 deletions exercises/matching-brackets/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[canonical-tests]

# paired square brackets
"81ec11da-38dd-442a-bcf9-3de7754609a5" = true

# empty string
"287f0167-ac60-4b64-8452-a0aa8f4e5238" = true

# unpaired brackets
"6c3615a3-df01-4130-a731-8ef5f5d78dac" = true

# wrong ordered brackets
"9d414171-9b98-4cac-a4e5-941039a97a77" = true

# wrong closing bracket
"f0f97c94-a149-4736-bc61-f2c5148ffb85" = true

# paired with whitespace
"754468e0-4696-4582-a30e-534d47d69756" = true

# partially paired brackets
"ba84f6ee-8164-434a-9c3e-b02c7f8e8545" = true

# simple nested brackets
"3c86c897-5ff3-4a2b-ad9b-47ac3a30651d" = true

# several paired brackets
"2d137f2c-a19e-4993-9830-83967a2d4726" = true

# paired and nested brackets
"2e1f7b56-c137-4c92-9781-958638885a44" = true

# unopened closing brackets
"84f6233b-e0f7-4077-8966-8085d295c19b" = true

# unpaired and nested brackets
"9b18c67d-7595-4982-b2c5-4cb949745d49" = true

# paired and wrong nested brackets
"a0205e34-c2ac-49e6-a88a-899508d7d68e" = true

# paired and incomplete brackets
"ef47c21b-bcfd-4998-844c-7ad5daad90a8" = true

# too many closing brackets
"a4675a40-a8be-4fc2-bc47-2a282ce6edbe" = true

# math expression
"99255f93-261b-4435-a352-02bdecc9bdf2" = true

# complex latex expression
"8e357d79-f302-469a-8515-2561877256a1" = true
43 changes: 43 additions & 0 deletions exercises/react/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[canonical-tests]

# input cells have a value
"c51ee736-d001-4f30-88d1-0c8e8b43cd07" = true

# an input cell's value can be set
"dedf0fe0-da0c-4d5d-a582-ffaf5f4d0851" = true

# compute cells calculate initial value
"5854b975-f545-4f93-8968-cc324cde746e" = true

# compute cells take inputs in the right order
"25795a3d-b86c-4e91-abe7-1c340e71560c" = true

# compute cells update value when dependencies are changed
"c62689bf-7be5-41bb-b9f8-65178ef3e8ba" = true

# compute cells can depend on other compute cells
"5ff36b09-0a88-48d4-b7f8-69dcf3feea40" = true

# compute cells fire callbacks
"abe33eaf-68ad-42a5-b728-05519ca88d2d" = true

# callback cells only fire on change
"9e5cb3a4-78e5-4290-80f8-a78612c52db2" = true

# callbacks do not report already reported values
"ada17cb6-7332-448a-b934-e3d7495c13d3" = true

# callbacks can fire from multiple cells
"ac271900-ea5c-461c-9add-eeebcb8c03e5" = true

# callbacks can be added and removed
"95a82dcc-8280-4de3-a4cd-4f19a84e3d6f" = true

# removing a callback multiple times doesn't interfere with other callbacks
"f2a7b445-f783-4e0e-8393-469ab4915f2a" = true

# callbacks should only be called once even if multiple dependencies change
"daf6feca-09e0-4ce5-801d-770ddfe1c268" = true

# callbacks should not be called if dependencies change but output value doesn't change
"9a5b159f-b7aa-4729-807e-f1c38a46d377" = true
19 changes: 19 additions & 0 deletions exercises/rna-transcription/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[canonical-tests]

# Empty RNA sequence
"b4631f82-c98c-4a2f-90b3-c5c2b6c6f661" = true

# RNA complement of cytosine is guanine
"a9558a3c-318c-4240-9256-5d5ed47005a6" = true

# RNA complement of guanine is cytosine
"6eedbb5c-12cb-4c8b-9f51-f8320b4dc2e7" = true

# RNA complement of thymine is adenine
"870bd3ec-8487-471d-8d9a-a25046488d3e" = true

# RNA complement of adenine is uracil
"aade8964-02e1-4073-872f-42d3ffd74c5f" = true

# RNA complement
"79ed2757-f018-4f47-a1d7-34a559392dbf" = true
16 changes: 16 additions & 0 deletions exercises/sieve/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[canonical-tests]

# no primes under two
"88529125-c4ce-43cc-bb36-1eb4ddd7b44f" = true

# find first prime
"4afe9474-c705-4477-9923-840e1024cc2b" = true

# find primes up to 10
"974945d8-8cd9-4f00-9463-7d813c7f17b7" = true

# limit is prime
"2e2417b7-3f3a-452a-8594-b9af08af6d82" = true

# find primes up to 1000
"92102a05-4c7c-47de-9ed0-b7d5fcd00f21" = true

0 comments on commit 0a8a760

Please sign in to comment.