@@ -525,6 +525,9 @@ void main() {
525
525
const String version = '1.0.1' ;
526
526
final RepositoryPackage plugin =
527
527
createFakePlugin ('plugin' , packagesDir, version: version);
528
+ processRunner.mockProcessesForExecutable['git-show' ] = < io.Process > [
529
+ MockProcess (stdout: 'version: 1.0.0' ),
530
+ ];
528
531
529
532
const String changelog = '''
530
533
## NEXT
@@ -538,7 +541,7 @@ void main() {
538
541
539
542
bool hasError = false ;
540
543
final List <String > output = await runCapturingPrint (
541
- runner, < String > ['version-check' , '--base-sha=main' , '--against-pub' ],
544
+ runner, < String > ['version-check' , '--base-sha=main' ],
542
545
errorHandler: (Error e) {
543
546
expect (e, isA <ToolExit >());
544
547
hasError = true ;
@@ -559,6 +562,9 @@ void main() {
559
562
test ('fails if the version increases without replacing NEXT' , () async {
560
563
final RepositoryPackage plugin =
561
564
createFakePlugin ('plugin' , packagesDir, version: '1.0.1' );
565
+ processRunner.mockProcessesForExecutable['git-show' ] = < io.Process > [
566
+ MockProcess (stdout: 'version: 1.0.0' ),
567
+ ];
562
568
563
569
const String changelog = '''
564
570
## NEXT
@@ -570,7 +576,7 @@ void main() {
570
576
571
577
bool hasError = false ;
572
578
final List <String > output = await runCapturingPrint (
573
- runner, < String > ['version-check' , '--base-sha=main' , '--against-pub' ],
579
+ runner, < String > ['version-check' , '--base-sha=main' ],
574
580
errorHandler: (Error e) {
575
581
expect (e, isA <ToolExit >());
576
582
hasError = true ;
@@ -613,6 +619,30 @@ void main() {
613
619
);
614
620
});
615
621
622
+ // This handles imports of a package with a NEXT section.
623
+ test ('allows NEXT for a new package' , () async {
624
+ final RepositoryPackage plugin =
625
+ createFakePackage ('a_package' , packagesDir, version: '1.0.0' );
626
+
627
+ const String changelog = '''
628
+ ## NEXT
629
+ * Some changes that should be listed in the next release.
630
+ ## 1.0.0
631
+ * Some other changes.
632
+ ''' ;
633
+ plugin.changelogFile.writeAsStringSync (changelog);
634
+
635
+ final List <String > output = await runCapturingPrint (
636
+ runner, < String > ['version-check' , '--base-sha=main' ]);
637
+ expect (
638
+ output,
639
+ containsAllInOrder (< Matcher > [
640
+ contains ('Unable to find previous version at git base' ),
641
+ contains ('Found NEXT; validating next version in the CHANGELOG' ),
642
+ ]),
643
+ );
644
+ });
645
+
616
646
test (
617
647
'fails gracefully if the version headers are not found due to using the wrong style' ,
618
648
() async {
0 commit comments