Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions fixtures/dart_async/test/futures_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'package:test/test.dart';
import '../dart_async.dart';

Future<Duration> measureTime(Future<void> Function() action) async {
final start = DateTime.now();
final stopwatch = Stopwatch()..start();
await action();
final end = DateTime.now();
return end.difference(start);
stopwatch.stop();
return stopwatch.elapsed;
}

// The DELAY-based timing assertions below check a LOWER bound only: that an
Expand Down Expand Up @@ -93,7 +93,7 @@ void main() {
await sleep(ms: 200);
});

expect(time.inMilliseconds > 200, true);
expect(time.inMilliseconds >= 200, true);
});

test('sequential_future', () async {
Expand All @@ -103,7 +103,7 @@ void main() {
expect(resultAlice, 'Hello, Alice!');
expect(resultBob, 'Hello, Bob!');
});
expect(time.inMilliseconds > 300, true);
expect(time.inMilliseconds >= 300, true);
});

test('concurrent_future', () async {
Expand Down Expand Up @@ -153,7 +153,7 @@ void main() {
final resultAlice = await sayAfterWithTokio(ms: 200, who: 'Alice');
expect(resultAlice, 'Hello, Alice (with Tokio)!');
});
expect(time.inMilliseconds > 200, true);
expect(time.inMilliseconds >= 200, true);
});

test('fallible_function_and_method', () async {
Expand Down
Loading