Skip to content

Commit

Permalink
new tests for install with ==
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Oct 20, 2024
1 parent ce2c006 commit dfd2643
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions t/cli/dist.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,37 @@ use lib 't/lib';
use Test::More;
use TestCommand;

subtest 'command: dist' => sub {
# this will be the same as ==5.024004
# CPANSA-perl-2018-6798
# CPANSA-perl-2018-6913
# CPANSA-perl-2018-6797
# CPANSA-perl-2017-12814
# CPANSA-perl-2017-12837

subtest 'command: dist perl version' => sub {
my $expected_reports = 14;
my( $stdout, $stderr, $exit ) = TestCommand->command( 'dist', 'perl', '5.024004' );
is $exit, 64 + $expected_reports, "there are $expected_reports reports";
};

=pod
subtest 'command: dist perl ==version' => sub {
my $expected_reports = 14;
my( $stdout, $stderr, $exit ) = TestCommand->command( 'dist', 'perl', '==5.024004' );
unlike $stdout, qr/CPANSA-perl-2023-47(?:100|038)/, 'CVE-2023-471100 nor CVE-2023-47028 are in the reports';
unlike $stdout, qr/CPANSA-perl-2023-47(?:100|038)/, 'CVE-2023-47100 nor CVE-2023-47038 are in the reports';
is $exit, 64 + $expected_reports, "there are $expected_reports reports";
};
subtest 'command: dist perl >=version' => sub {
my $expected_reports = 14;
my( $stdout, $stderr, $exit ) = TestCommand->command( 'dist', 'perl', '>=5.024004' );
unlike $stdout, qr/CPANSA-perl-2023-47(?:100|038)/, 'CVE-2023-47100 nor CVE-2023-47038 are in the reports';
is $exit, 64 + $expected_reports, "there are $expected_reports reports";
};
=cut

done_testing;

0 comments on commit dfd2643

Please sign in to comment.