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

Fix calculation version number without build part #4056

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/src/validator/relative_version_numbering.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ Consider one of:
}

extension on Version {
Version withoutBuild() =>
Version(major, minor, patch, pre: preRelease.join('.'));
Version withoutBuild() => Version(
major,
minor,
patch,
pre: preRelease.isEmpty ? null : preRelease.join('.'),
);
}
10 changes: 10 additions & 0 deletions test/validator/relative_version_numbering_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ The latest published version is 2.0.2.
await expectValidation();
});

test('Releasing a build-release causes no hint', () async {
final server = await servePackages();
server.serve(
'test_pkg',
'1.0.0',
);
await d.validPackage(version: '1.0.0+0').create();
await expectValidation();
});

group('should consider a package valid if it', () {
test('is opting in to null-safety with previous null-safe version',
() async {
Expand Down
Loading