From 2442b1c26ba36d7b9a65249f2595c162ecaf297c Mon Sep 17 00:00:00 2001 From: Ricardo Signes Date: Sun, 30 Apr 2023 10:30:50 +0200 Subject: [PATCH] XXX: tests for "our $VERSION = v8.67.53" Right now, this fails weirdly. See #365, which says: > If you're doing the first release of a package, and you set the version > string to an unquoted v-string, such as > > our $VERSION = v1.0.1; > > Then the uploader will get a message saying they don't have an indexing > permission on the package. > > Putting double quotes around the v-string will fix it, so we should at least > recognise the problem and tell the uploader. --- t/mldistwatch-misc.t | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/t/mldistwatch-misc.t b/t/mldistwatch-misc.t index f75a4d290..d7178d85e 100644 --- a/t/mldistwatch-misc.t +++ b/t/mldistwatch-misc.t @@ -321,6 +321,36 @@ subtest "check various forms of version" => sub { ); }; +subtest "unquoted vstring version" => sub { + my $pause = PAUSE::TestPAUSE->init_new; + $pause->upload_author_fake(RJBS => { + name => 'Quod-Version', + version => '8.67.53', + packages => [ + 'Quod::Version' => { + version => 'v8.67.53', + layout => { version => 'our-literal' } + }, + ] + }); + + my $result = $pause->test_reindex; + + $pause->file_not_updated_ok( + $result->tmpdir + ->file(qw(cpan modules 02packages.details.txt.gz)), + "there were no things to update", + ); + + diag($_->{email}->as_string) for $result->deliveries; + + $result->email_ok( + [ + { subject => 'PAUSE indexer report Quod-Version-8.67.53.tar.gz' }, + ], + ); +}; + subtest "version assigned to a blob as a ref" => sub { my $pause = PAUSE::TestPAUSE->init_new; $pause->upload_author_fake(LUNATIC => 'Globby-Version-1.234.tar.gz', {