Skip to content

Commit c8ba0cc

Browse files
authored
Fix Namespace Assignment Test (#10289)
When a namespace is declared without a "=" assignment, there should be an error. I think the test did not check that the ouput contains an error. Noticed this because I saw an extra stack trace when running a test. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 9905c4a commit c8ba0cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

script/tool/test/gradle_check_command_test.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,16 +710,19 @@ dependencies {
710710
pluginName: pluginName, includeNameSpaceAsDeclaration: false);
711711
writeFakeManifest(example, isApp: true);
712712

713+
Error? commandError;
713714
final List<String> output = await runCapturingPrint(
714715
runner, <String>['gradle-check'], errorHandler: (Error e) {
715-
print((e as ToolExit).stackTrace);
716+
commandError = e;
716717
});
717718

719+
expect(commandError, isA<ToolExit>());
718720
expect(
719721
output,
720722
containsAllInOrder(
721723
<Matcher>[
722-
contains('Validating android/app/build.gradle'),
724+
contains('build.gradle must set a "namespace"'),
725+
contains('The following packages had errors:'),
723726
],
724727
));
725728
});

0 commit comments

Comments
 (0)