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
4ab68bd0
Unverified
Commit
4ab68bd0
authored
May 08, 2022
by
Danny Tuppeny
Committed by
GitHub
May 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use consistent date instead of DateTime.now() in evaluation tests (#103269)
parent
955e1ff3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
expression_evaluation_test.dart
...ls/test/integration.shard/expression_evaluation_test.dart
+5
-8
No files found.
packages/flutter_tools/test/integration.shard/expression_evaluation_test.dart
View file @
4ab68bd0
...
...
@@ -157,19 +157,16 @@ Future<void> evaluateTrivialExpressions(FlutterTestDriver flutter) async {
}
Future
<
void
>
evaluateComplexExpressions
(
FlutterTestDriver
flutter
)
async
{
final
ObjRef
res
=
await
flutter
.
evaluateInFrame
(
'new DateTime
.now(
).year'
);
expectValueOfType
(
res
,
InstanceKind
.
kInt
,
DateTime
.
now
().
year
.
toString
()
);
final
ObjRef
res
=
await
flutter
.
evaluateInFrame
(
'new DateTime
(2000
).year'
);
expectValueOfType
(
res
,
InstanceKind
.
kInt
,
'2000'
);
}
Future
<
void
>
evaluateComplexReturningExpressions
(
FlutterTestDriver
flutter
)
async
{
final
DateTime
now
=
DateTime
.
now
(
);
final
ObjRef
resp
=
await
flutter
.
evaluateInFrame
(
'new DateTime
.now(
)'
);
final
DateTime
date
=
DateTime
(
2000
);
final
ObjRef
resp
=
await
flutter
.
evaluateInFrame
(
'new DateTime
(2000
)'
);
expectInstanceOfClass
(
resp
,
'DateTime'
);
// Ensure we got a reasonable approximation. The more accurate we try to
// make this, the more likely it'll fail due to differences in the time
// in the remote VM and the local VM at the time the code runs.
final
ObjRef
res
=
await
flutter
.
evaluate
(
resp
.
id
,
r'"$year-$month-$day"'
);
expectValue
(
res
,
'
${
now.year}
-
${now.month}
-
${now
.day}
'
);
expectValue
(
res
,
'
${
date.year}
-
${date.month}
-
${date
.day}
'
);
}
void
expectInstanceOfClass
(
ObjRef
result
,
String
name
)
{
...
...
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