From 158328921d8ae9efc03ace5b01580d18e7057a82 Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Tue, 26 Mar 2024 12:04:52 -0700 Subject: [PATCH] Be tolerant of backticks around directory name in `pub` output. (#145768) This fixes https://github.com/flutter/flutter/issues/145766 The output of the pub command changed slightly with this change: https://dart.googlesource.com/pub/+/2179b765aa9071386be02d408b3c3caa82af98f5 Update the tests to be tolerant of the directory path being surrounded by backticks (or not) so that we are compatible with the current and upcoming implementation. --- .../test/commands.shard/permeable/packages_test.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart b/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart index 2c2045da71a..7b30df43662 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart @@ -218,9 +218,11 @@ void main() { expect(mockStdio.stdout.writes.map(utf8.decode), allOf( - contains(matches(RegExp(r'Resolving dependencies in .+flutter_project\.\.\.'))), + // The output of pub changed, adding backticks around the directory name. + // These regexes are tolerant of the backticks being present or absent. + contains(matches(RegExp(r'Resolving dependencies in .+flutter_project`?\.\.\.'))), contains(matches(RegExp(r'\+ flutter 0\.0\.0 from sdk flutter'))), - contains(matches(RegExp(r'Changed \d+ dependencies in .+flutter_project!'))), + contains(matches(RegExp(r'Changed \d+ dependencies in .+flutter_project`?!'))), ), );