in reply to Re^3: pl – Perl One-Liner Magic Wand: looking for feedback
in thread pl – Perl One-Liner Magic Wand: looking for feedback

Hello DanielPfeiffer,

I'm mad for oneliners.. :) so I'd like to investigate this, but I have some test failed (strawberry perl portable)

perl -v This is perl 5, version 26, subversion 0 (v5.26.0) built for MSWin32- +x64-multi-thread gmake -v GNU Make 4.2.1 cpan> test App::pl ... t/unit.t ....... 1/8 # Failed test '"C:\EX_D\ulisseDUE\perl5.26.64bit\perl\bin\perl.exe" +"-W" "../pl" "for( @A, [$A[0], 123456] ) { E Isodate( $_, 0 ), I( 0.0 +, $_ ), I( $_, \"+0\" ), I( $_, 1 ), D( $_, -80, \"+90\", \"-9.5\" ), + \"\"; Date \"08:45\", $_ }" "123456789" "123456789.0" "123456789.1" +"123456789.000001" "123456789.123456789"' # got: 'Subroutine Config::STORE redefined at C:/EX_D/ulisseDUE/perl5. +26.64bit/perl/vendor/lib/Portable/Config.pm line 68. # 1973-11-29T21:33:09.000000 +00:00 1973-11-29T21:33:09.000000 +00:00 +1973-11-29T21:33:09.000000 +00:00 1973-11-29T22:33:09.000000 +01:00 T +hu Nov 29 12:03:19.000000 -09:30 1973 Fri Nov 30 06:18:09.000000 +08: +45 1973 # 1973-11-29T21:33:09.000000 +00:00 1973-11-29T21:33:09.000000 +00:00 +1973-11-29T21:33:09.000000 +00:00 1973-11-29T22:33:09.000000 +01:00 T +hu Nov 29 12:03:19.000000 -09:30 1973 Fri Nov 30 06:18:09.000000 +08: +45 1973 # 1973-11-29T21:33:09.100000 +00:00 1973-11-29T21:33:09.100000 +00:00 +1973-11-29T21:33:09.100000 +00:00 1973-11-29T22:33:09.100000 +01:00 T +hu Nov 29 12:03:19.100000 -09:30 1973 Fri Nov 30 06:18:09.100000 +08: +45 1973 # 1973-11-29T21:33:09.000001 +00:00 1973-11-29T21:33:09.000001 +00:00 +1973-11-29T21:33:09.000001 +00:00 1973-11-29T22:33:09.000001 +01:00 T +hu Nov 29 12:03:19.000001 -09:30 1973 Fri Nov 30 06:18:09.000001 +08: +45 1973 # 1973-11-29T21:33:09.123456 +00:00 1973-11-29T21:33:09.123456 +00:00 +1973-11-29T21:33:09.123456 +00:00 1973-11-29T22:33:09.123456 +01:00 T +hu Nov 29 12:03:19.123456 -09:30 1973 Fri Nov 30 06:18:09.123456 +08: +45 1973 # 1973-11-29T21:33:09.123456 +00:00 1973-11-29T21:33:09.123456 +00:00 +1973-11-29T21:33:09.123456 +00:00 1973-11-29T22:33:09.123456 +01:00 T +hu Nov 29 12:03:19.123456 -09:30 1973 Fri Nov 30 06:18:09.123456 +08: +45 1973 # ' # expected: '1973-11-29T21:33:09.000000 +00:00 1973-11-29T21:33:09.000 +000 +00:00 1973-11-29T21:33:09.000000 +00:00 1973-11-29T22:33:09.0000 +00 +01:00 Thu Nov 29 12:03:19.000000 -09:30 1973 Fri Nov 30 06:18:09. +000000 +08:45 1973 # 1973-11-29T21:33:09.000000 +00:00 1973-11-29T21:33:09.000000 +00:00 +1973-11-29T21:33:09.000000 +00:00 1973-11-29T22:33:09.000000 +01:00 T +hu Nov 29 12:03:19.000000 -09:30 1973 Fri Nov 30 06:18:09.000000 +08: +45 1973 # 1973-11-29T21:33:09.100000 +00:00 1973-11-29T21:33:09.100000 +00:00 +1973-11-29T21:33:09.100000 +00:00 1973-11-29T22:33:09.100000 +01:00 T +hu Nov 29 12:03:19.100000 -09:30 1973 Fri Nov 30 06:18:09.100000 +08: +45 1973 # 1973-11-29T21:33:09.000001 +00:00 1973-11-29T21:33:09.000001 +00:00 +1973-11-29T21:33:09.000001 +00:00 1973-11-29T22:33:09.000001 +01:00 T +hu Nov 29 12:03:19.000001 -09:30 1973 Fri Nov 30 06:18:09.000001 +08: +45 1973 # 1973-11-29T21:33:09.123456 +00:00 1973-11-29T21:33:09.123456 +00:00 +1973-11-29T21:33:09.123456 +00:00 1973-11-29T22:33:09.123456 +01:00 T +hu Nov 29 12:03:19.123456 -09:30 1973 Fri Nov 30 06:18:09.123456 +08: +45 1973 # 1973-11-29T21:33:09.123456 +00:00 1973-11-29T21:33:09.123456 +00:00 +1973-11-29T21:33:09.123456 +00:00 1973-11-29T22:33:09.123456 +01:00 T +hu Nov 29 12:03:19.123456 -09:30 1973 Fri Nov 30 06:18:09.123456 +08: +45 1973 # ' # at ./test.pm line 50. t/unit.t ....... 2/8 # Looks like you failed 1 test of 8. t/unit.t ....... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/8 subtests Test Summary Report ------------------- t/unit.t (Wstat: 256 Tests: 8 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=6, Tests=80, 8 wallclock secs ( 0.03 usr + 0.01 sys = 0.05 CP +U) Result: FAIL Failed 1/6 test programs. 1/80 subtests failed. gmake: *** [Makefile:875: test_dynamic] Error 1 PFEIFFER/App-pl-0.90.2.tgz C:\EX_D\ulisseDUE\perl5.26.64bit\c\bin\gmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports PFEIFFER/App-pl-0.90.2.tgz Stopping: 'test' failed for 'App::pl'. Failed during this command: PFEIFFER/App-pl-0.90.2.tgz : make_test NO # as mentioned in the error (cpan> upgrade Portable::Config fails btw) +: cpan> r Portable::Config Package namespace installed latest in CPAN file Portable::Config 1.22 1.23 KMX/Portable-1.23.tar.g +z

The only thing I find atm is a SO post where #!perl -W seems guilty and you have use warnings 'all'; in all your tests.

HtH

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^5: pl – Perl One-Liner Magic Wand -- failing tests
by Daniel Pfeiffer (Acolyte) on Jun 17, 2022 at 22:09 UTC

    It's not the berries, because in the mean time cpantesters have reported success for 6 different Windows versions, all Strawberry.

    Something in yours is loading this non-standard variant of Config, where I don't even see why it would load Config at all. I have modified the failing test a bit: sub i tracks the modifications of %INC, using keydiff. Could you please run

    pl "$I = -1; sub i { ++$I; k $_, $INC{$_} for keys %INC } i; require Time::HiRes; i; for( @A, [$A[0], 123456] ) { E Isodate( $_, 0 ), I( 0.0, $_ ), I( $_, \"+0\" ), I( $_, 1 ), D( $_, -80, \"+90\", \"-9.5\" ), \"\"; Date \"08:45\", $_ } i" 123456789

    For me it records only a single change, the module I explicitly require. (Isodate would too, but I wanted to see it in isolation.) If you want more fun, what E would do for echoing refs, you can add this before the end quote: ; require Data::Dumper; i

    So much for maybe understanding. For the solution, I guess I'll have to drop my overzealous warnings (which I now realize, aren't complete anyway). Can you please remove '-W', from @cmd on line t/test.pm:51? Then please run perl t/unit.t

      Hello Daniel Pfeiffer,

      I hope the following will help

      cpan> look App::pl Working directory is R:\emoved\path\perl5.26.64bit\cpan\build\App-pl-0 +.90.2-1 Microsoft Windows [Versione 10.0.19044.1706] (c) Microsoft Corporation. Tutti i diritti sono riservati. C> cd t C>perl -lne "print if $. == 51" test.pm my @cmd = ($^X, $ENV{PLALT} // '../pl', @_); # +was: ($^X, '-W', $ENV{PLALT} // '../pl', @_) C>perl unit.t 1..8 ok 1 - "perl5.26.64bit\perl\bin\perl.exe" "../pl" "for( @A, [$A[0], 12 +3456] ) { E Isodate( $_, 0 ), I( 0.0, $_ ), I( $_, \"+0\" ), I( $_, 1 + ), D( $_, -80, \"+90\", \"-9.5\" ), \"\"; Date \"08:45\", $_ }" "123 +456789" "123456789.0" "123456789.1" "123456789.000001" "123456789.123 +456789" ok 2 - "perl5.26.64bit\perl\bin\perl.exe" "../pl" "$RESULT = \"$Q${quo +te}abc$q$Quote\"" ok 3 - "perl5.26.64bit\perl\bin\perl.exe" "../pl" "%R = qw(a 1 b 2 c 1 + d 3)" ok 4 - "perl5.26.64bit\perl\bin\perl.exe" "../pl" "%NUMBER = qw(a 1 b +2 c 1 d 3)" ok 5 - "perl5.26.64bit\perl\bin\perl.exe" "../pl" "-ENumber" "%N = qw( +a 1 b 2 c 1 d 3)" ok 6 - "perl5.26.64bit\perl\bin\perl.exe" "../pl" "-E" "N 3" "%N = qw( +a 1 b 2 c 1 d 3)" ok 7 - "perl5.26.64bit\perl\bin\perl.exe" "../pl" "form $_ = q!a%%b %% +1$d %x:%1$o %1$*1$b %%%1$X!, 27; tr/$/:/; F $_, 27" ok 8 - "perl5.26.64bit\perl\bin\perl.exe" "../pl" "-Mbignum" "Echo 123 +456789012345678901234567890 * 123456789012345678901234567890"

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      The Portable::Config error could be a red herring. The portable versions of Strawberry perl load Config and update its contents so the various paths are updated when code is run.

Re^5: pl – Perl One-Liner Magic Wand -- failing tests
by Anonymous Monk on Jun 16, 2022 at 13:32 UTC
    Wow, they load a module that's not warning safe :~( I'd just switched to ActivePerl to get 5.36, which is fine. I guess I'll tweak it so that I distribute with lesser warnings than I test myself.