You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #1450, two tests cases are added to the Hamming exercise. If one of the argument is empty, it throws an exception with message "[left|right] strand must not be empty":
{
"description": "disallow left empty strand",
"property": "distance",
"input": {
"strand1": "",
"strand2": "G"
},
"expected": {"error": "left strand must not be empty"}
},
{
"description": "disallow right empty strand",
"property": "distance",
"input": {
"strand1": "G",
"strand2": ""
},
"expected": {"error": "right strand must not be empty"}
}
This message apparently contradicts with the first test case, where both arguments are empty, it runs without any exceptions:
In my opinion, the error messages in these two cases, should be identical to the other different length exceptions, i.e. "left and right strands must be of equal length":
{
"description": "disallow first strand longer",
"property": "distance",
"input": {
"strand1": "AATG",
"strand2": "AAA"
},
"expected": {"error": "left and right strands must be of equal length"}
}
A significant issue from the current test case is the exercise from the Java track, in order to pass all the test cases, I have to do:
// Only throw this if left strand is empty and right strand is not
if (leftStrand.isEmpty() && !rightStrand.isEmpty())
throw new IllegalArgumentException("left strand must not be empty.");
// Only throw this if right strand is empty and left strand is not
if (rightStrand.isEmpty() && !leftStrand.isEmpty())
throw new IllegalArgumentException("right strand must not be empty.");
if (leftStrand.length() != rightStrand.length())
throw new IllegalArgumentException("leftStrand and rightStrand must be of equal length.");
where the condition and the message is not very consistent..
The text was updated successfully, but these errors were encountered:
HenryRLee
changed the title
Inconcise test cases in the Hamming exercise
Illogical test cases in the Hamming exercise
Aug 4, 2020
HenryRLee
changed the title
Illogical test cases in the Hamming exercise
Inconsistent test cases in the Hamming exercise
Aug 4, 2020
In #1450, two tests cases are added to the Hamming exercise. If one of the argument is empty, it throws an exception with message "[left|right] strand must not be empty":
This message apparently contradicts with the first test case, where both arguments are empty, it runs without any exceptions:
In my opinion, the error messages in these two cases, should be identical to the other different length exceptions, i.e. "left and right strands must be of equal length":
A significant issue from the current test case is the exercise from the Java track, in order to pass all the test cases, I have to do:
where the condition and the message is not very consistent..
The text was updated successfully, but these errors were encountered: