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
acdb909f
Unverified
Commit
acdb909f
authored
Aug 19, 2020
by
Jonah Williams
Committed by
GitHub
Aug 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[null-safety] enable null assertions for framework tests (#64071)
parent
b92f80e2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
23 deletions
+6
-23
test.dart
dev/bots/test.dart
+1
-1
raw_keyboard_web.dart
packages/flutter/lib/src/services/raw_keyboard_web.dart
+2
-2
text_painter_test.dart
packages/flutter/test/painting/text_painter_test.dart
+1
-1
text_span_test.dart
packages/flutter/test/painting/text_span_test.dart
+2
-19
No files found.
dev/bots/test.dart
View file @
acdb909f
...
...
@@ -538,7 +538,7 @@ Future<void> _runAddToAppLifeCycleTests() async {
Future
<
void
>
_runFrameworkTests
()
async
{
final
bq
.
BigqueryApi
bigqueryApi
=
await
_getBigqueryApi
();
final
List
<
String
>
nullSafetyOptions
=
<
String
>[
'--enable-experiment=non-nullable'
];
final
List
<
String
>
nullSafetyOptions
=
<
String
>[
'--enable-experiment=non-nullable'
,
'--null-assertions'
];
final
List
<
String
>
trackWidgetCreationAlternatives
=
<
String
>[
'--track-widget-creation'
,
'--no-track-widget-creation'
];
Future
<
void
>
runWidgets
()
async
{
...
...
packages/flutter/lib/src/services/raw_keyboard_web.dart
View file @
acdb909f
...
...
@@ -36,7 +36,7 @@ class RawKeyEventDataWeb extends RawKeyEventData {
///
/// See <https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key>
/// for more information.
final
String
key
;
final
String
?
key
;
/// The modifiers that were present when the key event occurred.
///
...
...
@@ -56,7 +56,7 @@ class RawKeyEventDataWeb extends RawKeyEventData {
final
int
metaState
;
@override
String
get
keyLabel
=>
key
;
String
?
get
keyLabel
=>
key
;
@override
PhysicalKeyboardKey
get
physicalKey
{
...
...
packages/flutter/test/painting/text_painter_test.dart
View file @
acdb909f
...
...
@@ -149,7 +149,7 @@ void main() {
test
(
'TextPainter error test'
,
()
{
final
TextPainter
painter
=
TextPainter
(
textDirection:
TextDirection
.
ltr
);
expect
(()
{
painter
.
paint
(
null
,
Offset
.
zero
);
},
throwsFlutterError
);
expect
(()
{
painter
.
paint
(
null
,
Offset
.
zero
);
},
anyOf
(
throwsFlutterError
,
throwsAssertionError
)
);
});
test
(
'TextPainter requires textDirection'
,
()
{
...
...
packages/flutter/test/painting/text_span_test.dart
View file @
acdb909f
...
...
@@ -6,8 +6,7 @@
import
'package:flutter/painting.dart'
;
import
'package:flutter/widgets.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
test
(
'TextSpan equals'
,
()
{
...
...
@@ -44,7 +43,6 @@ void main() {
TextSpan
(),
],
),
null
,
TextSpan
(
text:
'c'
,
),
...
...
@@ -59,7 +57,6 @@ void main() {
' "b"
\n
'
' TextSpan:
\n
'
' (empty)
\n
'
' <null child>
\n
'
' TextSpan:
\n
'
' "c"
\n
'
));
...
...
@@ -245,21 +242,7 @@ void main() {
null
,
],
);
FlutterError
error
;
try
{
text
.
computeToPlainText
(
StringBuffer
());
}
on
FlutterError
catch
(
e
)
{
error
=
e
;
}
expect
(
error
,
isNotNull
);
expect
(
error
.
toStringDeep
(),
'FlutterError
\n
'
' TextSpan contains a null child.
\n
'
' A TextSpan object with a non-null child list should not have any
\n
'
' nulls in its child list.
\n
'
' The full text in question was:
\n
'
' TextSpan("foo bar")
\n
'
);
expect
(()
=>
text
.
computeToPlainText
(
StringBuffer
()),
anyOf
(
throwsFlutterError
,
throwsAssertionError
));
});
}
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