Fix type errors in tests, these tests fork a process and when run with
--preview-dart-2 the forked process does not inherit this option and
they were being run in Dart 1 mode.
Change-Id: Idcdd41f6c13a8592bf7dc730d891c91fb75e887e
Reviewed-on: https://dart-review.googlesource.com/59200
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
diff --git a/tests/standalone_2/io/https_unauthorized_client.dart b/tests/standalone_2/io/https_unauthorized_client.dart
index 57d9bc6..6b7e8f6 100644
--- a/tests/standalone_2/io/https_unauthorized_client.dart
+++ b/tests/standalone_2/io/https_unauthorized_client.dart
@@ -26,7 +26,7 @@
Future runClients(int port) {
HttpClient client = new HttpClient();
- var testFutures = [];
+ var testFutures = <Future>[];
for (int i = 0; i < 20; ++i) {
testFutures.add(client.getUrl(Uri.parse('https://$HOST_NAME:$port/')).then(
(HttpClientRequest request) {
diff --git a/tests/standalone_2/io/process_check_arguments_script.dart b/tests/standalone_2/io/process_check_arguments_script.dart
index 76cff03..4c19479 100644
--- a/tests/standalone_2/io/process_check_arguments_script.dart
+++ b/tests/standalone_2/io/process_check_arguments_script.dart
@@ -10,13 +10,13 @@
class Expect {
static void isTrue(x) {
if (!x) {
- throw new Error("Not true");
+ throw new StateError("Not true");
}
}
static void equals(x, y) {
if (x != y) {
- throw new Error("Not equal");
+ throw new StateError("Not equal");
}
}
}
diff --git a/tests/standalone_2/io/regress_7679_test.dart b/tests/standalone_2/io/regress_7679_test.dart
index 6402237..63f11d3 100644
--- a/tests/standalone_2/io/regress_7679_test.dart
+++ b/tests/standalone_2/io/regress_7679_test.dart
@@ -14,7 +14,7 @@
class Expect {
static void isTrue(var x) {
if (!identical(x, true)) {
- throw new Error("Not identical");
+ throw new StateError("Not identical");
}
}
}
diff --git a/tests/standalone_2/io/secure_unauthorized_client.dart b/tests/standalone_2/io/secure_unauthorized_client.dart
index f08e92b..c830c96 100644
--- a/tests/standalone_2/io/secure_unauthorized_client.dart
+++ b/tests/standalone_2/io/secure_unauthorized_client.dart
@@ -28,7 +28,7 @@
const HOST_NAME = "localhost";
Future runClients(int port) {
- var testFutures = [];
+ var testFutures = <Future>[];
for (int i = 0; i < 20; ++i) {
testFutures.add(SecureSocket
.connect(HOST_NAME, port, context: clientContext)