#977 Sync word-count#981
Conversation
|
This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested. If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos. For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
|
Thanks for helping! And welcome to the PHP track. I'll look through this at the weekend, I currently have no time left. |
|
Unfortunately I'm a bit busy with private projects, so I can't really continue with this right now |
mk-mxp
left a comment
There was a problem hiding this comment.
Thanks a lot for your work! You are invited to continue when your time allows. We are all volunteers here, and this will stay for at least 4 weeks for you to continue.
In addition to the fixes listed below, I'd like to have all tests formatted to fit a smaller code view better. In the online editor, the tests are shown in a small column ~62 chars wide. So I think we should use more lines like so:
$this->assertEquals(
['word' => 1],
wordCount('word'),
);And when the expected array becomes to long, please spread it over multiple lines like this:
$this->assertEquals(
[
'one' => 1,
'fish' => 4,
'two' => 1,
'red' => 1,
'blue' => 1,
],
wordCount('one fish two fish red fish blue fish'),
);Please add the trailing comma after the wordCount() calls and the last array items, too, when you use multiple lines.
Again, thanks a lot for your contribution. I'm looking forward for your changes!
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
mk-mxp
left a comment
There was a problem hiding this comment.
Thanks a lot! That looks great now.
|
Hmm, single quotes and apostrophes make a lot of trouble now. Let me get into it... |
|
For the record: 428 students have solved the exercise so far. I think adding single quotes and apostrophes is worth breaking them. |
|
You can run the tests locally, to see if they will pass CI. The README has instructions. There need to be more Regular Expressions to replace occurances of single quotes, but keep the apostrophes. The failures are here: https://github.com/exercism/php/actions/runs/26769201971/job/78905441267?pr=981#step:6:1171 |
mk-mxp
left a comment
There was a problem hiding this comment.
Thanks a lot for making this happen!
tests.tomlconfig.jsonauto-sync.txtexample.phpandWordCountTest.phpRef: #977