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
61362cff
Unverified
Commit
61362cff
authored
Aug 18, 2020
by
Alexander Aprelev
Committed by
GitHub
Aug 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move away from deprecated NoSuchMethodError to NoSuchMethodError.withInvocation (#63974)
parent
473744df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
error_reporting_test.dart
packages/flutter/test/foundation/error_reporting_test.dart
+6
-4
No files found.
packages/flutter/test/foundation/error_reporting_test.dart
View file @
61362cff
...
@@ -162,22 +162,24 @@ Future<void> main() async {
...
@@ -162,22 +162,24 @@ Future<void> main() async {
test
(
'Error reporting - NoSuchMethodError'
,
()
async
{
test
(
'Error reporting - NoSuchMethodError'
,
()
async
{
expect
(
console
,
isEmpty
);
expect
(
console
,
isEmpty
);
final
dynamic
exception
=
NoSuchMethodError
(
5
,
#foo
,
<
dynamic
>[
2
,
4
],
null
);
// ignore: deprecated_member_use
final
dynamic
exception
=
NoSuchMethodError
.
withInvocation
(
5
,
Invocation
.
method
(
#foo
,
<
dynamic
>[
2
,
4
]));
FlutterError
.
dumpErrorToConsole
(
FlutterErrorDetails
(
FlutterError
.
dumpErrorToConsole
(
FlutterErrorDetails
(
exception:
exception
,
exception:
exception
,
));
));
expect
(
console
.
join
(
'
\n
'
),
matches
(
expect
(
console
.
join
(
'
\n
'
),
matches
(
r'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n'
r'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n'
r'The following NoSuchMethodError was thrown:\n'
r'The following NoSuchMethodError was thrown:\n'
r'Receiver: 5\n'
r'int has no foo method accepting arguments \(_, _\)\n'
r'Tried calling: foo = 2, 4\n'
r'════════════════════════════════════════════════════════════════════════════════════════════════════$'
,
r'════════════════════════════════════════════════════════════════════════════════════════════════════$'
,
));
));
console
.
clear
();
console
.
clear
();
FlutterError
.
dumpErrorToConsole
(
FlutterErrorDetails
(
FlutterError
.
dumpErrorToConsole
(
FlutterErrorDetails
(
exception:
exception
,
exception:
exception
,
));
));
expect
(
console
.
join
(
'
\n
'
),
'Another exception was thrown: NoSuchMethodError: Receiver: 5'
);
expect
(
console
.
join
(
'
\n
'
),
'Another exception was thrown: NoSuchMethodError: int has no foo method accepting arguments (_, _)'
);
console
.
clear
();
console
.
clear
();
FlutterError
.
resetErrorCount
();
FlutterError
.
resetErrorCount
();
});
});
...
...
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