Skip to content

Commit 6614ee7

Browse files
committed
added invalid error message constants to test
1 parent 46b9b9e commit 6614ee7

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

script/tool/test/update_dependency_command_test.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,18 @@ dev_dependencies:
614614
'8.12.12'
615615
];
616616

617+
const String invalidGradleAgpVersionError = '''
618+
A version with a valid format (maximum 2-3 numbers separated by 1-2 periods) must be provided.
619+
1. The first number must have one or two digits
620+
2. The second number must have one or two digits
621+
3. If present, the third number must have a single digit''';
622+
623+
const String invalidKgpVersionError = '''
624+
A version with a valid format (3 numbers separated by 2 periods) must be provided.
625+
1. The first number must have one digit
626+
2. The second number must have one digit
627+
3. The third number must have one or two digits''';
628+
617629
group('gradle', () {
618630
for (final String gradleVersion in invalidGradleAgpVersionsFormat) {
619631
test('throws because gradleVersion: $gradleVersion is invalid',
@@ -633,11 +645,7 @@ dev_dependencies:
633645
expect(
634646
output,
635647
containsAllInOrder(<Matcher>[
636-
contains('''
637-
A version with a valid format (maximum 2-3 numbers separated by 1-2 periods) must be provided.
638-
1. The first number must have one or two digits
639-
2. The second number must have one or two digits
640-
3. If present, the third number must have a single digit'''),
648+
contains(invalidGradleAgpVersionError),
641649
]),
642650
);
643651
});
@@ -925,11 +933,7 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
925933
expect(
926934
output,
927935
containsAllInOrder(<Matcher>[
928-
contains('''
929-
A version with a valid format (maximum 2-3 numbers separated by 1-2 periods) must be provided.
930-
1. The first number must have one or two digits
931-
2. The second number must have one or two digits
932-
3. If present, the third number must have a single digit'''),
936+
contains(invalidGradleAgpVersionError),
933937
]),
934938
);
935939
});
@@ -1067,11 +1071,7 @@ plugins {
10671071
expect(
10681072
output,
10691073
containsAllInOrder(<Matcher>[
1070-
contains('''
1071-
A version with a valid format (3 numbers separated by 2 periods) must be provided.
1072-
1. The first number must have one digit
1073-
2. The second number must have one digit
1074-
3. The third number must have one or two digits'''),
1074+
contains(invalidKgpVersionError),
10751075
]),
10761076
);
10771077
});

0 commit comments

Comments
 (0)