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
5865c14d
Unverified
Commit
5865c14d
authored
Apr 22, 2021
by
Alexandre Ardhuin
Committed by
GitHub
Apr 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add trailing commas in flutter/test/animation (#80852)
parent
d9638d25
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
79 deletions
+84
-79
animation_controller_test.dart
...ges/flutter/test/animation/animation_controller_test.dart
+57
-51
animations_test.dart
packages/flutter/test/animation/animations_test.dart
+5
-6
curves_test.dart
packages/flutter/test/animation/curves_test.dart
+18
-16
tween_test.dart
packages/flutter/test/animation/tween_test.dart
+4
-6
No files found.
packages/flutter/test/animation/animation_controller_test.dart
View file @
5865c14d
...
...
@@ -385,7 +385,7 @@ void main() {
' A given AnimationController cannot be disposed more than once.
\n
'
' The following AnimationController object was disposed multiple
\n
'
' times:
\n
'
' AnimationController#00000(⏮ 0.000; paused; DISPOSED)
\n
'
' AnimationController#00000(⏮ 0.000; paused; DISPOSED)
\n
'
,
),
);
final
DiagnosticPropertiesBuilder
builder
=
DiagnosticPropertiesBuilder
();
...
...
@@ -966,41 +966,44 @@ void main() {
expect
(
error
.
toStringDeep
(),
'FlutterError
\n
'
' AnimationController.forward() called with no default duration.
\n
'
' The "duration" property should be set, either in the constructor
\n
'
' or later, before calling the forward() function.
\n
'
' AnimationController.forward() called with no default duration.
\n
'
' The "duration" property should be set, either in the constructor
\n
'
' or later, before calling the forward() function.
\n
'
,
);
controller
.
dispose
();
});
test
(
'AnimationController animateTo() will throw an error if there is no explicit duration '
'and default duration'
,
()
{
final
AnimationController
controller
=
AnimationController
(
vsync:
const
TestVSync
(),
);
late
FlutterError
error
;
try
{
controller
.
animateTo
(
0.8
);
}
on
FlutterError
catch
(
e
)
{
error
=
e
;
}
expect
(
error
,
isNotNull
);
expect
(
error
.
toStringDeep
(),
'FlutterError
\n
'
test
(
'AnimationController animateTo() will throw an error if there is no explicit duration '
'and default duration'
,
()
{
final
AnimationController
controller
=
AnimationController
(
vsync:
const
TestVSync
(),
);
late
FlutterError
error
;
try
{
controller
.
animateTo
(
0.8
);
}
on
FlutterError
catch
(
e
)
{
error
=
e
;
}
expect
(
error
,
isNotNull
);
expect
(
error
.
toStringDeep
(),
'FlutterError
\n
'
' AnimationController.animateTo() called with no explicit duration
\n
'
' and no default duration.
\n
'
' Either the "duration" argument to the animateTo() method should
\n
'
' be provided, or the "duration" property should be set, either in
\n
'
' the constructor or later, before calling the animateTo()
\n
'
' function.
\n
'
);
' function.
\n
'
,
);
controller
.
dispose
();
});
controller
.
dispose
();
},
);
test
(
'AnimationController reverse() will throw an error if there is no default duration or reverseDuration'
,
()
{
final
AnimationController
controller
=
AnimationController
(
...
...
@@ -1018,43 +1021,46 @@ void main() {
expect
(
error
.
toStringDeep
(),
'FlutterError
\n
'
' AnimationController.reverse() called with no default duration or
\n
'
' reverseDuration.
\n
'
' The "duration" or "reverseDuration" property should be set,
\n
'
' either in the constructor or later, before calling the reverse()
\n
'
' function.
\n
'
' AnimationController.reverse() called with no default duration or
\n
'
' reverseDuration.
\n
'
' The "duration" or "reverseDuration" property should be set,
\n
'
' either in the constructor or later, before calling the reverse()
\n
'
' function.
\n
'
,
);
controller
.
dispose
();
});
test
(
'AnimationController animateBack() will throw an error if there is no explicit duration and '
'no default duration or reverseDuration'
,
()
{
final
AnimationController
controller
=
AnimationController
(
vsync:
const
TestVSync
(),
);
late
FlutterError
error
;
try
{
controller
.
animateBack
(
0.8
);
}
on
FlutterError
catch
(
e
)
{
error
=
e
;
}
expect
(
error
,
isNotNull
);
expect
(
error
.
toStringDeep
(),
'FlutterError
\n
'
test
(
'AnimationController animateBack() will throw an error if there is no explicit duration and '
'no default duration or reverseDuration'
,
()
{
final
AnimationController
controller
=
AnimationController
(
vsync:
const
TestVSync
(),
);
late
FlutterError
error
;
try
{
controller
.
animateBack
(
0.8
);
}
on
FlutterError
catch
(
e
)
{
error
=
e
;
}
expect
(
error
,
isNotNull
);
expect
(
error
.
toStringDeep
(),
'FlutterError
\n
'
' AnimationController.animateBack() called with no explicit
\n
'
' duration and no default duration or reverseDuration.
\n
'
' Either the "duration" argument to the animateBack() method should
\n
'
' be provided, or the "duration" or "reverseDuration" property
\n
'
' should be set, either in the constructor or later, before calling
\n
'
' the animateBack() function.
\n
'
);
' the animateBack() function.
\n
'
,
);
controller
.
dispose
();
});
controller
.
dispose
();
},
);
});
}
...
...
packages/flutter/test/animation/animations_test.dart
View file @
5865c14d
...
...
@@ -243,19 +243,18 @@ void main() {
error
=
e
;
}
expect
(
error
,
isNotNull
);
expect
(
error
!.
toStringDeep
(),
matches
(
expect
(
error
!.
toStringDeep
(),
// RegExp matcher is required here due to flutter web and flutter mobile generating
// slightly different floating point numbers
// in Flutter web 0.0 sometimes just appears as 0. or 0
RegExp
(
r''
'
matches
(
RegExp
(
r''
'
FlutterError
Invalid curve endpoint at
\
d+(
\
.
\
d*)?
\
.
Curves must map 0
\
.0 to near zero and 1
\
.0 to near one but
BogusCurve mapped
\
d+(
\
.
\
d*)? to
\
d+(
\
.
\
d*)?, which is near
\
d+(
\
.
\
d*)?
\
.
'''
,
multiLine:
true
),
));
'''
,
multiLine:
true
)),
);
});
test
(
'CurvedAnimation running with different forward and reverse durations.'
,
()
{
...
...
packages/flutter/test/animation/curves_test.dart
View file @
5865c14d
...
...
@@ -398,14 +398,15 @@ void main() {
// Monotonically increasing in X.
expect
(
CatmullRomCurve
.
validateControlPoints
(
const
<
Offset
>[
Offset
(
0.2
,
0.25
),
Offset
(
0.01
,
0.25
),
],
tension:
0.0
,
),
isFalse
);
CatmullRomCurve
.
validateControlPoints
(
const
<
Offset
>[
Offset
(
0.2
,
0.25
),
Offset
(
0.01
,
0.25
),
],
tension:
0.0
,
),
isFalse
,
);
expect
(()
{
CatmullRomCurve
(
const
<
Offset
>[
...
...
@@ -418,14 +419,15 @@ void main() {
// X within range (0.0, 1.0).
expect
(
CatmullRomCurve
.
validateControlPoints
(
const
<
Offset
>[
Offset
(
0.2
,
0.25
),
Offset
(
1.01
,
0.25
),
],
tension:
0.0
,
),
isFalse
);
CatmullRomCurve
.
validateControlPoints
(
const
<
Offset
>[
Offset
(
0.2
,
0.25
),
Offset
(
1.01
,
0.25
),
],
tension:
0.0
,
),
isFalse
,
);
expect
(()
{
CatmullRomCurve
(
const
<
Offset
>[
...
...
packages/flutter/test/animation/tween_test.dart
View file @
5865c14d
...
...
@@ -28,7 +28,7 @@ void main() {
expect
(
error
.
diagnostics
.
map
((
DiagnosticsNode
node
)
=>
node
.
toString
()),
<
String
>[
'Cannot lerp between "Instance of
\'
Object
\'
" and "Instance of
\'
Object
\'
".'
,
'The type Object might not fully implement `+`, `-`, and/or `*`.
$kApiDocsLink
'
,
'There may be a dedicated "ObjectTween" for this type, or you may need to create one.'
'There may be a dedicated "ObjectTween" for this type, or you may need to create one.'
,
]);
});
...
...
@@ -59,7 +59,7 @@ void main() {
test
(
'throws flutter error when tweening types that do not fully satisfy tween requirements - Rect'
,
()
{
final
Tween
<
Rect
>
rectTween
=
Tween
<
Rect
>(
begin:
const
Rect
.
fromLTWH
(
0
,
0
,
10
,
10
),
end:
const
Rect
.
fromLTWH
(
2
,
2
,
2
,
2
)
end:
const
Rect
.
fromLTWH
(
2
,
2
,
2
,
2
)
,
);
FlutterError
?
error
;
...
...
@@ -185,9 +185,7 @@ void main() {
expect
(
rotationTween
.
lerp
(
0.0
),
equals
(
a
));
expect
(
rotationTween
.
lerp
(
1.0
),
equals
(
c
));
expect
(
rotationTween
.
lerp
(
0.5
).
absoluteError
(
a
.
clone
()..
rotateZ
(
0.5
)
),
rotationTween
.
lerp
(
0.5
).
absoluteError
(
a
.
clone
()..
rotateZ
(
0.5
)),
moreOrLessEquals
(
0.0
),
);
},
skip:
isWindows
);
// floating point math not quite deterministic on Windows?
...
...
@@ -210,7 +208,7 @@ void main() {
test
(
'ColorTween'
,
()
{
final
ColorTween
tween
=
ColorTween
(
begin:
const
Color
(
0xff000000
),
end:
const
Color
(
0xffffffff
)
end:
const
Color
(
0xffffffff
)
,
);
expect
(
tween
.
lerp
(
0.0
),
const
Color
(
0xff000000
));
expect
(
tween
.
lerp
(
0.5
),
const
Color
(
0xff7f7f7f
));
...
...
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