{ "exercise": "hamming", "comments": [ "Language implementations vary on the issue of unequal length strands.", "A language may elect to simplify this task by only presenting equal", "length test cases. For languages handling unequal length strands as", "error condition, unequal length test cases are included here and are", "indicated with an error object. Language idioms of errors or exceptions", "should be followed. Alternative interpretations such as ignoring excess", "length at the end are not represented here." ], "cases": [ { "uuid": "f6dcb64f-03b0-4b60-81b1-3c9dbf47e887", "description": "empty strands", "property": "distance", "input": { "strand1": "", "strand2": "" }, "expected": 0 }, { "uuid": "54681314-eee2-439a-9db0-b0636c656156", "description": "single letter identical strands", "property": "distance", "input": { "strand1": "A", "strand2": "A" }, "expected": 0 }, { "uuid": "294479a3-a4c8-478f-8d63-6209815a827b", "description": "single letter different strands", "property": "distance", "input": { "strand1": "G", "strand2": "T" }, "expected": 1 }, { "uuid": "9aed5f34-5693-4344-9b31-40c692fb5592", "description": "long identical strands", "property": "distance", "input": { "strand1": "GGACTGAAATCTG", "strand2": "GGACTGAAATCTG" }, "expected": 0 }, { "uuid": "cd2273a5-c576-46c8-a52b-dee251c3e6e5", "description": "long different strands", "property": "distance", "input": { "strand1": "GGACGGATTCTG", "strand2": "AGGACGGATTCT" }, "expected": 9 }, { "uuid": "919f8ef0-b767-4d1b-8516-6379d07fcb28", "description": "disallow first strand longer", "property": "distance", "input": { "strand1": "AATG", "strand2": "AAA" }, "expected": { "error": "left and right strands must be of equal length" } }, { "uuid": "b9228bb1-465f-4141-b40f-1f99812de5a8", "reimplements": "919f8ef0-b767-4d1b-8516-6379d07fcb28", "description": "disallow first strand longer", "comments": ["Normalises error messages"], "property": "distance", "input": { "strand1": "AATG", "strand2": "AAA" }, "expected": { "error": "strands must be of equal length" } }, { "uuid": "8a2d4ed0-ead5-4fdd-924d-27c4cf56e60e", "description": "disallow second strand longer", "property": "distance", "input": { "strand1": "ATA", "strand2": "AGTG" }, "expected": { "error": "left and right strands must be of equal length" } }, { "uuid": "dab38838-26bb-4fff-acbe-3b0a9bfeba2d", "reimplements": "8a2d4ed0-ead5-4fdd-924d-27c4cf56e60e", "description": "disallow second strand longer", "comments": ["Normalises error messages"], "property": "distance", "input": { "strand1": "ATA", "strand2": "AGTG" }, "expected": { "error": "strands must be of equal length" } }, { "uuid": "5dce058b-28d4-4ca7-aa64-adfe4e17784c", "description": "disallow left empty strand", "property": "distance", "input": { "strand1": "", "strand2": "G" }, "expected": { "error": "left strand must not be empty" } }, { "uuid": "db92e77e-7c72-499d-8fe6-9354d2bfd504", "reimplements": "5dce058b-28d4-4ca7-aa64-adfe4e17784c", "description": "disallow left empty strand", "comments": ["Normalises error messages"], "property": "distance", "input": { "strand1": "", "strand2": "G" }, "expected": { "error": "left and right strands must be of equal length" } }, { "uuid": "b764d47c-83ff-4de2-ab10-6cfe4b15c0f3", "reimplements": "db92e77e-7c72-499d-8fe6-9354d2bfd504", "description": "disallow empty first strand", "comments": ["Normalises error messages"], "property": "distance", "input": { "strand1": "", "strand2": "G" }, "expected": { "error": "strands must be of equal length" } }, { "uuid": "38826d4b-16fb-4639-ac3e-ba027dec8b5f", "description": "disallow right empty strand", "property": "distance", "input": { "strand1": "G", "strand2": "" }, "expected": { "error": "right strand must not be empty" } }, { "uuid": "920cd6e3-18f4-4143-b6b8-74270bb8f8a3", "reimplements": "38826d4b-16fb-4639-ac3e-ba027dec8b5f", "description": "disallow right empty strand", "comments": ["Normalises error messages"], "property": "distance", "input": { "strand1": "G", "strand2": "" }, "expected": { "error": "left and right strands must be of equal length" } }, { "uuid": "9ab9262f-3521-4191-81f5-0ed184a5aa89", "reimplements": "920cd6e3-18f4-4143-b6b8-74270bb8f8a3", "description": "disallow empty second strand", "comments": ["Normalises error messages"], "property": "distance", "input": { "strand1": "G", "strand2": "" }, "expected": { "error": "strands must be of equal length" } } ] }