Problem-specifications: hamming: add new test case

Created on 1 Sep 2018  路  1Comment  路  Source: exercism/problem-specifications

The function is supposed to find differences in two DNA strands, so I think it should throw an error if we don't have a valid DNA strand.

{
  "description": "disallow invalid dna strands",
  "property": "distance",
  "input": {
    "strand1": "ATA",
    "strand2": "AUA"
  },
  "expected": {
    "error": "both strands must be valid"
  }
}

Most helpful comment

We had this kind of test in earlier versions, but then we decided to remove it, as some languages have a type system that can avoid such faulty input.

Tracks that miss such a powerful typesystem should implement tests that do error handling in an idiomatic way.

>All comments

We had this kind of test in earlier versions, but then we decided to remove it, as some languages have a type system that can avoid such faulty input.

Tracks that miss such a powerful typesystem should implement tests that do error handling in an idiomatic way.

Was this page helpful?
0 / 5 - 0 ratings