Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1ac09088
Unverified
Commit
1ac09088
authored
Apr 28, 2020
by
kwkr
Committed by
GitHub
Apr 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix/use contains ignoring whitespace (#55887)
parent
9d7af39a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
42 deletions
+101
-42
attach_test.dart
...utter_tools/test/commands.shard/hermetic/attach_test.dart
+2
-2
config_test.dart
...utter_tools/test/commands.shard/hermetic/config_test.dart
+20
-5
devices_test.dart
...tter_tools/test/commands.shard/hermetic/devices_test.dart
+1
-1
run_test.dart
.../flutter_tools/test/commands.shard/hermetic/run_test.dart
+8
-4
channel_test.dart
packages/flutter_tools/test/general.shard/channel_test.dart
+16
-6
build_apk_test.dart
...ter_tools/test/general.shard/commands/build_apk_test.dart
+20
-9
build_appbundle_test.dart
...ols/test/general.shard/commands/build_appbundle_test.dart
+30
-14
runner_test.dart
.../flutter_tools/test/general.shard/runner/runner_test.dart
+4
-1
No files found.
packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart
View file @
1ac09088
...
...
@@ -648,7 +648,7 @@ void main() {
createTestCommandRunner
(
command
).
run
(<
String
>[
'attach'
]),
throwsToolExit
(),
);
expect
(
testLogger
.
statusText
,
contains
(
'No supported devices connected'
));
expect
(
testLogger
.
statusText
,
contains
IgnoringWhitespace
(
'No supported devices connected'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
testFileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -671,7 +671,7 @@ void main() {
createTestCommandRunner
(
command
).
run
(<
String
>[
'attach'
]),
throwsToolExit
(),
);
expect
(
testLogger
.
statusText
,
contains
(
'More than one device'
));
expect
(
testLogger
.
statusText
,
contains
IgnoringWhitespace
(
'More than one device'
));
expect
(
testLogger
.
statusText
,
contains
(
'xx1'
));
expect
(
testLogger
.
statusText
,
contains
(
'yy2'
));
},
overrides:
<
Type
,
Generator
>{
...
...
packages/flutter_tools/test/commands.shard/hermetic/config_test.dart
View file @
1ac09088
...
...
@@ -161,7 +161,10 @@ void main() {
'--enable-web'
]);
expect
(
testLogger
.
statusText
,
contains
(
'You may need to restart any open editors'
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'You may need to restart any open editors'
),
);
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
mockUsage
,
});
...
...
@@ -183,10 +186,22 @@ void main() {
'config'
,
]);
expect
(
testLogger
.
statusText
,
contains
(
'enable-web: true (Unavailable)'
));
expect
(
testLogger
.
statusText
,
contains
(
'enable-linux-desktop: true (Unavailable)'
));
expect
(
testLogger
.
statusText
,
contains
(
'enable-windows-desktop: true (Unavailable)'
));
expect
(
testLogger
.
statusText
,
contains
(
'enable-macos-desktop: true (Unavailable)'
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'enable-web: true (Unavailable)'
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'enable-linux-desktop: true (Unavailable)'
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'enable-windows-desktop: true (Unavailable)'
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'enable-macos-desktop: true (Unavailable)'
),
);
verifyNoAnalytics
();
},
overrides:
<
Type
,
Generator
>{
AndroidStudio:
()
=>
mockAndroidStudio
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart
View file @
1ac09088
...
...
@@ -31,7 +31,7 @@ void main() {
testUsingContext
(
'no error when no connected devices'
,
()
async
{
final
DevicesCommand
command
=
DevicesCommand
();
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'devices'
]);
expect
(
testLogger
.
statusText
,
contains
(
'No devices detected'
));
expect
(
testLogger
.
statusText
,
contains
IgnoringWhitespace
(
'No devices detected'
));
},
overrides:
<
Type
,
Generator
>{
AndroidSdk:
()
=>
null
,
DeviceManager:
()
=>
DeviceManager
(),
...
...
packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
View file @
1ac09088
...
...
@@ -113,9 +113,10 @@ void main() {
expect
(
e
,
isA
<
ToolExit
>());
}
final
BufferLogger
bufferLogger
=
globals
.
logger
as
BufferLogger
;
expect
(
bufferLogger
.
statusText
,
contains
(
'Changing current working directory to:'
));
expect
(
bufferLogger
.
statusText
,
containsIgnoringWhitespace
(
'Changing current working directory to:'
),
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -230,7 +231,10 @@ void main() {
expect
(
e
.
message
,
null
);
}
expect
(
testLogger
.
statusText
,
contains
(
userMessages
.
flutterNoSupportedDevices
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
userMessages
.
flutterNoSupportedDevices
),
);
},
overrides:
<
Type
,
Generator
>{
DeviceManager:
()
=>
mockDeviceManager
,
FileSystem:
()
=>
fs
,
...
...
packages/flutter_tools/test/general.shard/channel_test.dart
View file @
1ac09088
...
...
@@ -35,7 +35,10 @@ void main() {
// The bots may return an empty list of channels (network hiccup?)
// and when run locally the list of branches might be different
// so we check for the header text rather than any specific channel name.
expect
(
testLogger
.
statusText
,
contains
(
'Flutter channels:'
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'Flutter channels:'
),
);
}
testUsingContext
(
'list'
,
()
async
{
...
...
@@ -212,7 +215,10 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
called
(
1
);
expect
(
testLogger
.
statusText
,
contains
(
"Switching to flutter channel 'beta'..."
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
"Switching to flutter channel 'beta'..."
),
);
expect
(
testLogger
.
errorText
,
hasLength
(
0
));
when
(
mockProcessManager
.
start
(
...
...
@@ -290,12 +296,16 @@ void main() {
environment:
anyNamed
(
'environment'
),
)).
called
(
1
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
"Successfully switched to flutter channel 'beta'."
));
expect
(
testLogger
.
statusText
,
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
"Successfully switched to flutter channel 'beta'."
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
"To ensure that you're on the latest build "
"from this channel, run 'flutter upgrade'"
));
"from this channel, run 'flutter upgrade'"
),
);
expect
(
testLogger
.
errorText
,
hasLength
(
0
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
packages/flutter_tools/test/general.shard/commands/build_apk_test.dart
View file @
1ac09088
...
...
@@ -375,12 +375,18 @@ void main() {
);
},
throwsToolExit
(
message:
'Gradle task assembleRelease failed with exit code 1'
));
expect
(
testLogger
.
statusText
,
contains
(
'The shrinker may have failed to optimize the Java bytecode.'
));
expect
(
testLogger
.
statusText
,
contains
(
'To disable the shrinker, pass the `--no-shrink` flag to this command.'
));
expect
(
testLogger
.
statusText
,
contains
(
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'The shrinker may have failed to optimize the Java bytecode.'
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'To disable the shrinker, pass the `--no-shrink` flag to this command.'
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
),
);
verify
(
mockUsage
.
sendEvent
(
'build'
,
...
...
@@ -433,11 +439,16 @@ void main() {
);
},
throwsToolExit
());
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
"Your app isn't using AndroidX"
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
"Your app isn't using AndroidX"
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'To avoid potential build failures, you can quickly migrate your app by '
'following the steps on https://goo.gl/CP92wY'
)
)
,
);
verify
(
mockUsage
.
sendEvent
(
'build'
,
...
...
packages/flutter_tools/test/general.shard/commands/build_appbundle_test.dart
View file @
1ac09088
...
...
@@ -303,12 +303,18 @@ void main() {
);
},
throwsToolExit
(
message:
'Gradle task bundleRelease failed with exit code 1'
));
expect
(
testLogger
.
statusText
,
contains
(
'The shrinker may have failed to optimize the Java bytecode.'
));
expect
(
testLogger
.
statusText
,
contains
(
'To disable the shrinker, pass the `--no-shrink` flag to this command.'
));
expect
(
testLogger
.
statusText
,
contains
(
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'The shrinker may have failed to optimize the Java bytecode.'
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'To disable the shrinker, pass the `--no-shrink` flag to this command.'
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
),
);
verify
(
mockUsage
.
sendEvent
(
'build'
,
...
...
@@ -361,11 +367,16 @@ void main() {
);
},
throwsToolExit
());
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
"Your app isn't using AndroidX"
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
"Your app isn't using AndroidX"
),
);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'To avoid potential build failures, you can quickly migrate your app by '
'following the steps on https://goo.gl/CP92wY'
)
)
,
);
verify
(
mockUsage
.
sendEvent
(
'build'
,
...
...
@@ -412,12 +423,17 @@ void main() {
);
},
throwsToolExit
());
expect
(
testLogger
.
statusText
,
not
(
containsIgnoringWhitespace
(
"Your app isn't using AndroidX"
)));
expect
(
testLogger
.
statusText
,
not
(
containsIgnoringWhitespace
(
'To avoid potential build failures, you can quickly migrate your app by '
'following the steps on https://goo.gl/CP92wY'
))
testLogger
.
statusText
,
not
(
containsIgnoringWhitespace
(
"Your app isn't using AndroidX"
)),
);
expect
(
testLogger
.
statusText
,
not
(
containsIgnoringWhitespace
(
'To avoid potential build failures, you can quickly migrate your app by '
'following the steps on https://goo.gl/CP92wY'
),
)
);
verify
(
mockUsage
.
sendEvent
(
'build'
,
...
...
packages/flutter_tools/test/general.shard/runner/runner_test.dart
View file @
1ac09088
...
...
@@ -103,7 +103,10 @@ void main() {
await
completer
.
future
;
final
String
errorText
=
testLogger
.
errorText
;
expect
(
errorText
,
contains
(
'Oops; flutter has exited unexpectedly: "an exception % --".
\n
'
));
expect
(
errorText
,
containsIgnoringWhitespace
(
'Oops; flutter has exited unexpectedly: "an exception % --".
\n
'
),
);
final
File
log
=
globals
.
fs
.
file
(
'/flutter_01.log'
);
final
String
logContents
=
log
.
readAsStringSync
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment