exercism / perl5

Exercism exercises in Perl 5.
https://exercism.org/tracks/perl5
MIT License
28 stars 51 forks source link

[Simple Cipher, Robot Simulator, Linked List, Simple Linked List, Queen Attack, Pythagorean Triplet, Saddle Points] Tests pass, always #532

Closed kareila closed 11 months ago

kareila commented 1 year ago

As I reported in the site forum, the test suite in the Perl 5 version of Simple Cipher is currently broken. All of the tests pass on any given input when using the online editor.

Link to discussion: http://forum.exercism.org/t/tests-in-perl-5-version-of-simple-cipher-seem-broken/4565/2

github-actions[bot] commented 1 year ago

Hello. Thanks for opening an issue on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.

That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.


Note: If this issue has been pre-approved, please link back to this issue on the forum thread and a maintainer or staff member will reopen it.

kotp commented 1 year ago

Thank you for reporting this.

kareila commented 1 year ago

I just discovered that Robot Simulator has the same problem.

m-dango commented 1 year ago

I'll look into updating these exercises to use the canonical test data next. Both of these exercises have sadly been neglected for quite some time.

kareila commented 1 year ago

I just discovered that Linked List and Simple Linked List both have the same problem.

MatthiasMuth commented 1 year ago

I have the same problem in Queen Attack, too. Thanks for help!

kareila commented 1 year ago

Adding Pythagorean Triplet to the list.

kareila commented 1 year ago

Adding Saddle Points to the list. I believe I've now checked every currently available exercise.

MatthiasMuth commented 1 year ago

I have noticed that all tests that show the symptom (tests in the editor succeed without actually running) have one thing in common: They all use use Test2::Bundle::More; and they all contain calls like ... or diag explain ...;

All other exercises that I downloaded (I didn't download all, though) and that work correctly in the Exercism editor that I have checked use use Test2::V0; and none of them contains any calls to explain (with the exception of list-ops, which uses Test2::Bundle::More, but still does not use explain).

The thing is that explain used to be a member function of Test::More, but it is explicitly not contained in any of the Test2 suites anymore. So if any test fails, the test produces a run time error for calling an unknown subroutine. See explanations why explain is not in Test2::Bundle::More [here](https://metacpan.org/pod/Test2::Bundle::More#explain()).

Maybe this observation helps in closing in on the problem.

m-dango commented 1 year ago

I've created a PR for the new simple-cipher tests, which will require a solution: https://github.com/exercism/perl5/pull/535

m-dango commented 1 year ago

PR created for reimplementation of robot-simulator, requires solution: https://github.com/exercism/perl5/pull/536

m-dango commented 1 year ago

Reimplementation of queen-attack: https://github.com/exercism/perl5/pull/537

m-dango commented 1 year ago

Reimplementation of pythagorean-triplet: https://github.com/exercism/perl5/pull/538

m-dango commented 1 year ago

Reimplementation of saddle-points: https://github.com/exercism/perl5/pull/539

habere-et-dispertire commented 1 year ago

Reimplementation of pythagorean-triplet: #538

perl solution 💜 ## # https://github.com/exercism/perl5/pull/538#issuecomment-1575584895 ## sub triplets_with_sum { my ($sum) = @_; my @solutions; for my $a ( 1 .. $sum ) { my $numerator = 2*$a**2 + $sum**2 - 2*$sum*$a; my $denominator = 2*( $sum - $a ); if ( $denominator > 0 and $numerator % $denominator == 0 ) { my $c = $numerator / $denominator; my $b = $sum - $a - $c; push @solutions, [ $a, $b, $c ] if $b > $a; } } return [ @solutions ]; }
m-dango commented 1 year ago

PRs are open to resolve all issues in here. I've marked linked-list and simple-linked-list as WIP as there are changes to be made to the track before these can be updated.