implicit-casts:false in dev (#45787)
This commit is contained in:
committed by
GitHub
parent
fa0c49d775
commit
ec1a015045
@@ -47,7 +47,7 @@ class FakeProcessManager extends Mock implements ProcessManager {
|
||||
void verifyCalls(List<String> calls) {
|
||||
int index = 0;
|
||||
for (String call in calls) {
|
||||
expect(call.split(' '), orderedEquals(invocations[index].positionalArguments[0]));
|
||||
expect(call.split(' '), orderedEquals(invocations[index].positionalArguments[0] as Iterable<dynamic>));
|
||||
index++;
|
||||
}
|
||||
expect(invocations.length, equals(calls.length));
|
||||
@@ -66,17 +66,17 @@ class FakeProcessManager extends Mock implements ProcessManager {
|
||||
|
||||
Future<Process> _nextProcess(Invocation invocation) async {
|
||||
invocations.add(invocation);
|
||||
return Future<Process>.value(_popProcess(invocation.positionalArguments[0]));
|
||||
return Future<Process>.value(_popProcess(invocation.positionalArguments[0] as List<String>));
|
||||
}
|
||||
|
||||
ProcessResult _nextResultSync(Invocation invocation) {
|
||||
invocations.add(invocation);
|
||||
return _popResult(invocation.positionalArguments[0]);
|
||||
return _popResult(invocation.positionalArguments[0] as List<String>);
|
||||
}
|
||||
|
||||
Future<ProcessResult> _nextResult(Invocation invocation) async {
|
||||
invocations.add(invocation);
|
||||
return Future<ProcessResult>.value(_popResult(invocation.positionalArguments[0]));
|
||||
return Future<ProcessResult>.value(_popResult(invocation.positionalArguments[0] as List<String>));
|
||||
}
|
||||
|
||||
void _setupMock() {
|
||||
@@ -117,8 +117,8 @@ class FakeProcessManager extends Mock implements ProcessManager {
|
||||
/// A fake process that can be used to interact with a process "started" by the FakeProcessManager.
|
||||
class FakeProcess extends Mock implements Process {
|
||||
FakeProcess(ProcessResult result, {void stdinResults(String input)})
|
||||
: stdoutStream = Stream<List<int>>.fromIterable(<List<int>>[result.stdout.codeUnits]),
|
||||
stderrStream = Stream<List<int>>.fromIterable(<List<int>>[result.stderr.codeUnits]),
|
||||
: stdoutStream = Stream<List<int>>.value((result.stdout as String).codeUnits),
|
||||
stderrStream = Stream<List<int>>.value((result.stderr as String).codeUnits),
|
||||
desiredExitCode = result.exitCode,
|
||||
stdinSink = IOSink(StringStreamConsumer(stdinResults)) {
|
||||
_setupMock();
|
||||
|
||||
@@ -328,13 +328,13 @@ void main() {
|
||||
expect(contents, contains('"channel": "dev"'));
|
||||
// Make sure old matching entries are removed.
|
||||
expect(contents, isNot(contains('v0.0.0')));
|
||||
final Map<String, dynamic> jsonData = json.decode(contents);
|
||||
final List<dynamic> releases = jsonData['releases'];
|
||||
final Map<String, dynamic> jsonData = json.decode(contents) as Map<String, dynamic>;
|
||||
final List<dynamic> releases = jsonData['releases'] as List<dynamic>;
|
||||
expect(releases.length, equals(3));
|
||||
// Make sure the new entry is first (and hopefully it takes less than a
|
||||
// minute to go from publishArchive above to this line!).
|
||||
expect(
|
||||
DateTime.now().difference(DateTime.parse(releases[0]['release_date'])),
|
||||
DateTime.now().difference(DateTime.parse(releases[0]['release_date'] as String)),
|
||||
lessThan(const Duration(minutes: 1)),
|
||||
);
|
||||
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
|
||||
|
||||
Reference in New Issue
Block a user