Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync Knapsack #787

Merged
merged 2 commits into from
Aug 12, 2024
Merged

Sync Knapsack #787

merged 2 commits into from
Aug 12, 2024

Conversation

fejan-malek
Copy link
Contributor

@fejan-malek fejan-malek commented Aug 12, 2024

#782

This PR contains no major changes except @testdox updated in test case file.

Copy link

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.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@mk-mxp
Copy link
Contributor

mk-mxp commented Aug 12, 2024

@fejan-malek Do you have time to re-structure the tests like this:

    public function testNoItems(): void
    {
        $expected = 0;
        $maximumWeight = 100;
        $items = [];

        $knapsack = new Knapsack();
        $actual = $knapsack->getMaximumValue($maximumWeight, $items);

        $this->assertEquals($expected, $actual);
    }

This would greatly enhance readability for students using the online editor. The current test methods do not contain the object creation and the long lines require scolling horizontally.

If you have no time, I will do that after merging your PR. That is OK, we all have a life besides Exercism.

@fejan-malek
Copy link
Contributor Author

Yes, I am a little busy with a project at work.

Do we need to implement this in all test cases or only this single test case?

Copy link
Contributor

@mk-mxp mk-mxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you very much. And it's not "late", it's just in time 😃

@mk-mxp mk-mxp merged commit 455e73f into exercism:main Aug 12, 2024
12 checks passed
@mk-mxp mk-mxp added x:action/sync Sync content with its latest version x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:type/content Work on content (e.g. exercises, concepts) x:size/small Small amount of work x:rep/small Small amount of reputation labels Aug 12, 2024
@fejan-malek fejan-malek deleted the sync-knapsack branch August 13, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/sync Sync content with its latest version x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:rep/small Small amount of reputation x:size/small Small amount of work x:type/content Work on content (e.g. exercises, concepts)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants