Hi,
I would like to suggest an improvement of the Nucleotide Count Exercise in PHP.
The description indicates, that an invalid string (containing other letters than AGCT) should give an error, but that’s currently not the case.
"GATTACA" -> 'A': 3, 'C': 1, 'G': 1, 'T': 2
"INVALID" -> error
I my opinion either the exercise description should be added, or the test cases.
If the testcase I would add an extra test like:
public function testDNASequenceWithInvalidChar(): void
{
$this->expectException(Exception::class);
nucleotideCount('AGCTZ');
}
This would then make the users ensure that invalid chars isn’t used like the description says.
I would be happy to provide the PR if the test case should be added.
mk-mxp
February 6, 2024, 5:17pm
2
Dear Tomas,
nearly all exercises in the PHP track are not in sync to the Exercism problem specifications. This is due to a lack of contributors, helping to keep the tests in sync with the test cases listed there:
{
"exercise": "nucleotide-count",
"cases": [
{
"uuid": "3e5c30a8-87e2-4845-a815-a49671ade970",
"description": "empty strand",
"property": "nucleotideCounts",
"input": {
"strand": ""
},
"expected": {
"A": 0,
"C": 0,
"G": 0,
"T": 0
}
},
{
"uuid": "a0ea42a6-06d9-4ac6-828c-7ccaccf98fec",
"description": "can count one nucleotide in single-character input",
This file has been truncated. show original
The test case you request is already listed in the problem specification, and it would be very welcome if you could implement it. And sync the rest of the Nucleotide Count
tests to the problem specification, too.
Thanks for your reply. I’ll see what I can do.
I have created the PR with the synchronized tests.
exercism:main
← tomasnorre:improve-nucleotide-count-tests
opened 08:14PM - 06 Feb 24 UTC
Adjusted tests, to problem specifications [1] and as agreed in forum [2]. Please… let me know if changes wanted. I have tested that they work with my locally solved Nucleotide Count Exercise.
1) https://github.com/exercism/problem-specifications/blob/main/exercises/nucleotide-count/canonical-data.json
2) https://forum.exercism.org/t/improvement-of-exercise-nucleotide-count/9651/1
I have allowed myself to add an additional PR, with improvements to README.md
exercism:main
← tomasnorre:update-readme
opened 08:26PM - 06 Feb 24 UTC
We haven't agreed on this change, so feel free to reject it.
Currently, the G… itHub copy function isn't working with the `> ./bin/install.sh` command.
It will end up in a loop waiting for input, and write an empty `bin/install.sh` file.
By removing the `>` it can be copied directly into a terminal and the commands can be executed as wanted.