Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Unified Diff: lib/src/descriptor/file_descriptor.dart

Issue 1152453009: pkg/scheduled_test: fix analyzer hints (Closed) Base URL: https://github.com/dart-lang/scheduled_test.git@master
Patch Set: more better? Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/src/descriptor/file_descriptor.dart
diff --git a/lib/src/descriptor/file_descriptor.dart b/lib/src/descriptor/file_descriptor.dart
index ca7704f4cf68713c00a9b0ad5efcb982bb017904..f8ed29a1c2edff8f60ec4c872c496338bc4dbb98 100644
--- a/lib/src/descriptor/file_descriptor.dart
+++ b/lib/src/descriptor/file_descriptor.dart
@@ -10,7 +10,6 @@ import 'dart:io';
import 'dart:math' as math;
import 'package:path/path.dart' as path;
-import 'package:stack_trace/stack_trace.dart';
import '../../descriptor.dart';
import '../../scheduled_test.dart';
@@ -82,10 +81,11 @@ class _BinaryFileDescriptor extends FileDescriptor {
_BinaryFileDescriptor(String name, List<int> contents)
: super._(name, contents);
- Future _validateNow(List<int> actualContents) {
+ Future _validateNow(List<int> actualContents) async {
nweiz 2015/06/04 19:20:10 Don't use async/await in scheduled test until issu
kevmoo 2015/06/04 19:23:46 Done.
if (orderedIterableEquals(contents, actualContents)) return null;
// TODO(nweiz): show a hex dump here if the data is small enough.
- fail("File '$name' didn't contain the expected binary data.");
+ throw new TestFailure(
+ "File '$name' didn't contain the expected binary data.");
nweiz 2015/06/04 19:20:10 Why aren't you calling fail() here anymore?
kevmoo 2015/06/04 19:23:46 analyzer yells about having one flow w/ a return v
}
}
@@ -95,8 +95,8 @@ class _StringFileDescriptor extends FileDescriptor {
Future _validateNow(List<int> actualContents) {
if (orderedIterableEquals(contents, actualContents)) return null;
- throw _textMismatchMessage(textContents,
- new String.fromCharCodes(actualContents));
+ throw new TestFailure(_textMismatchMessage(
+ textContents, new String.fromCharCodes(actualContents)));
}
String _textMismatchMessage(String expected, String actual) {

Powered by Google App Engine
This is Rietveld 408576698