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

Remove given, when, and smartmatch operators #70

Merged
merged 1 commit into from
Oct 21, 2023

Conversation

ppisar
Copy link
Contributor

@ppisar ppisar commented Aug 8, 2023

Perl 5.38.0 deprecated smartmatch. New warning messages caused tests to fail:

    given is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 572.
    when is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 573.
    when is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 576.
    Smartmatch is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 741.

    #   Failed test 'no warnings'
    #   at /usr/share/perl5/Test/Builder.pm line 193.
    # There were 24 warning(s)
    #     Previous test 0 ''
    #     given is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Utils.pm line 237.
    #  at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Utils.pm line 237.
    # 	require MooseX/App/Utils.pm called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
    # 	MooseX::App::Exporter::BEGIN() called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
    # 	eval {...} called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
    # 	require MooseX/App/Exporter.pm called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
    # 	MooseX::App::BEGIN() called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
    # 	eval {...} called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
    # 	require MooseX/App.pm called at t/testlib/Test01.pm line 4
    # 	Test01::BEGIN() called at t/testlib/Test01.pm line 4
    # 	eval {...} called at t/testlib/Test01.pm line 4
    # 	require Test01.pm called at t/01_basic.t line 11
    # 	main::BEGIN() called at t/01_basic.t line 11
    # 	eval {...} called at t/01_basic.t line 11
    #
    # ----------

Since smartmatch will be removed from Perl 5.42, this patch fixes the test failures by replacing given, when, and ~~ operator with a plain, old Perl.

#69

Perl 5.38.0 deprecated smartmatch. New warning messages caused tests
to fail:

    given is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 572.
    when is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 573.
    when is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 576.
    Smartmatch is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 741.

    #   Failed test 'no warnings'
    #   at /usr/share/perl5/Test/Builder.pm line 193.
    # There were 24 warning(s)
    #     Previous test 0 ''
    #     given is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Utils.pm line 237.
    #  at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Utils.pm line 237.
    # 	require MooseX/App/Utils.pm called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
    # 	MooseX::App::Exporter::BEGIN() called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
    # 	eval {...} called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
    # 	require MooseX/App/Exporter.pm called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
    # 	MooseX::App::BEGIN() called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
    # 	eval {...} called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
    # 	require MooseX/App.pm called at t/testlib/Test01.pm line 4
    # 	Test01::BEGIN() called at t/testlib/Test01.pm line 4
    # 	eval {...} called at t/testlib/Test01.pm line 4
    # 	require Test01.pm called at t/01_basic.t line 11
    # 	main::BEGIN() called at t/01_basic.t line 11
    # 	eval {...} called at t/01_basic.t line 11
    #
    # ----------

Since smartmatch will be removed from Perl 5.42, this patch fixes the
test failures by replacing given, when, and ~~ operator with a plain,
old Perl.

<maros#69>
@vendethiel
Copy link

Also interested in seeing this merged :-).

@mschout
Copy link

mschout commented Sep 1, 2023

+1

1 similar comment
@dboehmer
Copy link

+1

@maros maros merged commit fba8610 into maros:master Oct 21, 2023
@maros
Copy link
Owner

maros commented Oct 21, 2023

Merged and release on cpan as 1.43. Thank you for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants