Version 2.10.0-152.0.dev
Merge commit '46903413bc2cfb1e9184c8f9b0de98ed435a4171' into 'dev'
diff --git a/DEPS b/DEPS
index 8e76008..881deca 100644
--- a/DEPS
+++ b/DEPS
@@ -44,7 +44,7 @@
# co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
# hashes. It requires access to the dart-build-access group, which EngProd
# has.
- "co19_rev": "827f96b4cddf68cd12049ad5612c53e215b58fcf",
+ "co19_rev": "b7660861df12eb489243a591e45f251f8cf8c4a8",
"co19_2_rev": "e48b3090826cf40b8037648f19d211e8eab1b4b6",
# The internal benchmarks to use. See go/dart-benchmarks-internal
diff --git a/tests/kernel/unsorted/regression_flutter51828_test.dart b/pkg/front_end/testcases/general/regression_flutter51828.dart
similarity index 100%
rename from tests/kernel/unsorted/regression_flutter51828_test.dart
rename to pkg/front_end/testcases/general/regression_flutter51828.dart
diff --git a/pkg/front_end/testcases/general/regression_flutter51828.dart.outline.expect b/pkg/front_end/testcases/general/regression_flutter51828.dart.outline.expect
new file mode 100644
index 0000000..22ce718
--- /dev/null
+++ b/pkg/front_end/testcases/general/regression_flutter51828.dart.outline.expect
@@ -0,0 +1,39 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A*
+ ;
+ method foo(dynamic x) → asy::Future<void>* async
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class B extends core::Object {
+ synthetic constructor •() → self::B*
+ ;
+ method bar(dynamic x) → asy::Future<void>* async
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic async
+ ;
diff --git a/pkg/front_end/testcases/general/regression_flutter51828.dart.strong.expect b/pkg/front_end/testcases/general/regression_flutter51828.dart.strong.expect
new file mode 100644
index 0000000..f3a4286
--- /dev/null
+++ b/pkg/front_end/testcases/general/regression_flutter51828.dart.strong.expect
@@ -0,0 +1,39 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A*
+ : super core::Object::•()
+ ;
+ method foo(dynamic x) → asy::Future<void>* async {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class B extends core::Object {
+ synthetic constructor •() → self::B*
+ : super core::Object::•()
+ ;
+ method bar(dynamic x) → asy::Future<void>* async {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic async
+ return <asy::Future<void>*>[new self::A::•().{self::A::foo}(await null), new self::B::•().{self::B::bar}(await null)];
diff --git a/pkg/front_end/testcases/general/regression_flutter51828.dart.strong.transformed.expect b/pkg/front_end/testcases/general/regression_flutter51828.dart.strong.transformed.expect
new file mode 100644
index 0000000..c0ef0a7
--- /dev/null
+++ b/pkg/front_end/testcases/general/regression_flutter51828.dart.strong.transformed.expect
@@ -0,0 +1,119 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "dart:async" as asy;
+import "dart:_internal" as _in;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A*
+ : super core::Object::•()
+ ;
+ method foo(dynamic x) → asy::Future<void>* /* originally async */ {
+ final asy::_AsyncAwaitCompleter<void>* :async_completer = new asy::_AsyncAwaitCompleter::•<void>();
+ FutureOr<void>* :return_value;
+ dynamic :async_stack_trace;
+ (dynamic) →* dynamic :async_op_then;
+ (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
+ core::int* :await_jump_var = 0;
+ dynamic :await_ctx_var;
+ function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
+ try {
+ #L1:
+ {}
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
+ return;
+ }
+ on dynamic catch(dynamic exception, core::StackTrace* stack_trace) {
+ :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+ }
+ :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
+ :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+ :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+ :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+ return :async_completer.{asy::Completer::future};
+ }
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class B extends core::Object {
+ synthetic constructor •() → self::B*
+ : super core::Object::•()
+ ;
+ method bar(dynamic x) → asy::Future<void>* /* originally async */ {
+ final asy::_AsyncAwaitCompleter<void>* :async_completer = new asy::_AsyncAwaitCompleter::•<void>();
+ FutureOr<void>* :return_value;
+ dynamic :async_stack_trace;
+ (dynamic) →* dynamic :async_op_then;
+ (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
+ core::int* :await_jump_var = 0;
+ dynamic :await_ctx_var;
+ function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
+ try {
+ #L2:
+ {}
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
+ return;
+ }
+ on dynamic catch(dynamic exception, core::StackTrace* stack_trace) {
+ :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+ }
+ :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
+ :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+ :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+ :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+ return :async_completer.{asy::Completer::future};
+ }
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic /* originally async */ {
+ final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
+ FutureOr<dynamic>* :return_value;
+ dynamic :async_stack_trace;
+ (dynamic) →* dynamic :async_op_then;
+ (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
+ core::int* :await_jump_var = 0;
+ dynamic :await_ctx_var;
+ dynamic :saved_try_context_var0;
+ dynamic :async_temporary_0;
+ dynamic :async_temporary_1;
+ function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
+ try {
+ #L3:
+ {
+ :async_temporary_1 = new self::A::•();
+ [yield] let dynamic #t1 = asy::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null;
+ :async_temporary_1 = _in::unsafeCast<self::A*>(:async_temporary_1).{self::A::foo}(_in::unsafeCast<core::Null?>(:result));
+ :async_temporary_0 = new self::B::•();
+ [yield] let dynamic #t2 = asy::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null;
+ :return_value = <asy::Future<void>*>[_in::unsafeCast<asy::Future<void>*>(:async_temporary_1), _in::unsafeCast<self::B*>(:async_temporary_0).{self::B::bar}(_in::unsafeCast<core::Null?>(:result))];
+ break #L3;
+ }
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
+ return;
+ }
+ on dynamic catch(dynamic exception, core::StackTrace* stack_trace) {
+ :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+ }
+ :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
+ :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+ :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+ :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+ return :async_completer.{asy::Completer::future};
+}
diff --git a/pkg/front_end/testcases/general/regression_flutter51828.dart.textual_outline.expect b/pkg/front_end/testcases/general/regression_flutter51828.dart.textual_outline.expect
new file mode 100644
index 0000000..10f8088
--- /dev/null
+++ b/pkg/front_end/testcases/general/regression_flutter51828.dart.textual_outline.expect
@@ -0,0 +1,9 @@
+class A {
+ Future<void> foo(x) async {}
+}
+
+class B {
+ Future<void> bar(x) async {}
+}
+
+main() async => [A().foo(await null), B().bar(await null)];
diff --git a/pkg/front_end/testcases/general/regression_flutter51828.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/regression_flutter51828.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..10f8088
--- /dev/null
+++ b/pkg/front_end/testcases/general/regression_flutter51828.dart.textual_outline_modelled.expect
@@ -0,0 +1,9 @@
+class A {
+ Future<void> foo(x) async {}
+}
+
+class B {
+ Future<void> bar(x) async {}
+}
+
+main() async => [A().foo(await null), B().bar(await null)];
diff --git a/tests/kernel/kernel.status b/tests/kernel/kernel.status
deleted file mode 100644
index 00f926c..0000000
--- a/tests/kernel/kernel.status
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-[ $compiler == dart2js ]
-unsorted/nsm_dispatcher_test: Skip # The test uses Symbol without MirrorsUsed
-unsorted/simple_literal_test/01: Skip # The test expects error for large integer literal.
-
-[ !$fasta ]
-unsorted/loop_test: Skip # This test uses optional new/const.
diff --git a/tests/kernel/unsorted/as_is_test.dart b/tests/kernel/unsorted/as_is_test.dart
deleted file mode 100644
index 846fdf1..0000000
--- a/tests/kernel/unsorted/as_is_test.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of class literals, is, and as expressions.
-
-import 'package:expect/expect.dart';
-
-class C {}
-
-class D extends C {}
-
-test0() => C;
-test1() => D;
-
-main() {
- var c = new C();
- var d = new D();
- Expect.isTrue(test0() == C);
- Expect.isTrue(test1() == D);
- Expect.isTrue(c is C);
- Expect.isTrue(c is! D);
- Expect.isTrue(d is C);
- Expect.isTrue(d is D);
- Expect.isTrue(c as C == c);
- Expect.isTrue(d as C == d);
- Expect.isTrue(d as D == d);
-}
diff --git a/tests/kernel/unsorted/block_scope_test.dart b/tests/kernel/unsorted/block_scope_test.dart
deleted file mode 100644
index 7a70e16..0000000
--- a/tests/kernel/unsorted/block_scope_test.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of block scoping.
-
-import 'package:expect/expect.dart';
-
-bool oracle() => true;
-
-test0() {
- var x = 'outer', y = x;
- Expect.isTrue(x == 'outer');
- Expect.isTrue(y == 'outer');
- {
- var x = 'inner';
- Expect.isTrue(x == 'inner');
- Expect.isTrue(y == 'outer');
- }
- Expect.isTrue(x == 'outer');
- Expect.isTrue(y == 'outer');
-
- if (oracle()) {
- var y = 'inner';
- Expect.isTrue(x == 'outer');
- Expect.isTrue(y == 'inner');
- } else {
- Expect.isTrue(false);
- }
- Expect.isTrue(x == 'outer');
- Expect.isTrue(y == 'outer');
-}
-
-var x = 'toplevel';
-
-test1() {
- var y = 'outer';
- Expect.isTrue(x == 'toplevel');
- Expect.isTrue(y == 'outer');
- {
- var x = 'inner';
- Expect.isTrue(x == 'inner');
- Expect.isTrue(y == 'outer');
- }
- Expect.isTrue(x == 'toplevel');
- Expect.isTrue(y == 'outer');
-
- if (oracle()) {
- var y = 'inner';
- Expect.isTrue(x == 'toplevel');
- Expect.isTrue(y == 'inner');
- } else {
- Expect.isTrue(false);
- }
- Expect.isTrue(x == 'toplevel');
- Expect.isTrue(y == 'outer');
-}
-
-main() {
- test0();
- test1();
-}
diff --git a/tests/kernel/unsorted/breakable_statement_test.dart b/tests/kernel/unsorted/breakable_statement_test.dart
deleted file mode 100644
index eb07239..0000000
--- a/tests/kernel/unsorted/breakable_statement_test.dart
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-testFor() {
- int current;
- for (int i = 0; i < 100; i++) {
- current = i;
- if (i > 41) break;
- }
- Expect.isTrue(current == 42);
-}
-
-testWhile() {
- int i = 0;
- while (i < 100) {
- if (++i > 41) break;
- }
- Expect.isTrue(i == 42);
-}
-
-testDoWhile() {
- int i = 0;
- do {
- if (++i > 41) break;
- } while (i < 100);
- Expect.isTrue(i == 42);
-}
-
-testLabledBreakOutermost() {
- int i = 0;
- outer:
- {
- middle:
- {
- while (i < 100) {
- if (++i > 41) break outer;
- }
- i++;
- }
- i++;
- }
- Expect.isTrue(i == 42);
-}
-
-testLabledBreakMiddle() {
- int i = 0;
- outer:
- {
- middle:
- {
- while (i < 100) {
- if (++i > 41) break middle;
- }
- i++;
- }
- i++;
- }
- Expect.isTrue(i == 43);
-}
-
-testLabledBreakInner() {
- int i = 0;
- outer:
- {
- middle:
- {
- while (i < 100) {
- if (++i > 41) break;
- }
- i++;
- }
- i++;
- }
- Expect.isTrue(i == 44);
-}
-
-main() {
- testFor();
- testWhile();
- testDoWhile();
- testLabledBreakOutermost();
- testLabledBreakMiddle();
- testLabledBreakInner();
-}
diff --git a/tests/kernel/unsorted/closures_regression_test.dart b/tests/kernel/unsorted/closures_regression_test.dart
deleted file mode 100644
index 9721385..0000000
--- a/tests/kernel/unsorted/closures_regression_test.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-f(fun) => fun();
-
-class A {
- identity(arg) {
- return f(() {
- print(this);
- return f(() {
- return this;
- });
- });
- }
-}
-
-main() {
- var a = new A();
- Expect.isTrue(identical(a.identity(42), a));
-}
diff --git a/tests/kernel/unsorted/closures_test.dart b/tests/kernel/unsorted/closures_test.dart
deleted file mode 100644
index df3430f..0000000
--- a/tests/kernel/unsorted/closures_test.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class Base {
- int constant1000() => 1000;
-}
-
-class Foo extends Base {
- final int base;
- Foo(this.base);
-
- nestedAdderFunction(a, b, c, d, e) {
- var result = a + b;
- return () {
- var result2 = c + d;
- return () {
- return base + result + result2 + e;
- };
- };
- }
-
- nestedAdderFunction2(a, b, c, d, e) {
- var result = a + b;
- return () {
- var base = super.constant1000;
- var result2 = c + d;
- return () {
- return base() + result + result2 + e;
- };
- };
- }
-}
-
-nestedAdderFunction(a, b, c, d, e) {
- var result = a + b;
- return () {
- var result2 = c + d;
- return () {
- return result + result2 + e;
- };
- };
-}
-
-main() {
- Expect.isTrue(nestedAdderFunction(1, 2, 3, 4, 5)()() == 15);
-
- var foo = new Foo(100);
- Expect.isTrue(foo.nestedAdderFunction(1, 2, 3, 4, 5)()() == 115);
- Expect.isTrue(foo.nestedAdderFunction2(1, 2, 3, 4, 5)()() == 1015);
-
- var funs = [];
- for (int i = 0; i < 3; i++) {
- funs.add(() => i);
- }
- Expect.isTrue((funs[0]() + funs[1]() + funs[2]()) == 3);
-
- var funs2 = [];
- for (var i in [0, 1, 2]) {
- funs2.add(() => i);
- }
- Expect.isTrue((funs2[0]() + funs2[1]() + funs2[2]()) == 3);
-}
diff --git a/tests/kernel/unsorted/conditional_test.dart b/tests/kernel/unsorted/conditional_test.dart
deleted file mode 100644
index 3bf30a3..0000000
--- a/tests/kernel/unsorted/conditional_test.dart
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of conditional expressions and statements and negation.
-
-import 'package:expect/expect.dart';
-
-mkTrue() => true;
-mkFalse() => false;
-
-check(b) {
- Expect.isTrue(b);
- return b;
-}
-
-main() {
- // Check that ?: gets the right answer.
- Expect.isTrue((mkTrue() ? 0 : 1) == 0);
- Expect.isTrue((mkFalse() ? 0 : 1) == 1);
- // Check that it doesn't evaluate all subexpressions.
- mkTrue() ? Expect.isTrue(true) : Expect.isTrue(false);
- mkFalse() ? Expect.isTrue(false) : Expect.isTrue(true);
-
- // Check that && and || get the right answers.
- Expect.isTrue(mkTrue() && mkTrue());
- Expect.isTrue(!(mkTrue() && mkFalse()));
- Expect.isTrue(!(mkFalse() && mkTrue()));
- Expect.isTrue(!(mkFalse() && mkFalse()));
- Expect.isTrue(mkTrue() || mkTrue());
- Expect.isTrue(mkTrue() || mkFalse());
- Expect.isTrue(mkFalse() || mkTrue());
- Expect.isTrue(!(mkFalse() || mkFalse()));
-
- // Check that they don't evaluate both subexpressions.
- mkTrue() && check(true);
- mkFalse() && check(false);
- mkTrue() || check(true);
- mkFalse() || check(true);
-
- // Check that if works.
- if (mkTrue()) {
- Expect.isTrue(true);
- } else {
- Expect.isTrue(false);
- }
- if (mkFalse()) {
- Expect.isTrue(false);
- } else {
- Expect.isTrue(true);
- }
- if (!mkTrue()) {
- Expect.isTrue(false);
- } else {
- Expect.isTrue(true);
- }
- if (!mkFalse()) {
- Expect.isTrue(true);
- } else {
- Expect.isTrue(false);
- }
-
- // Check that ?:, &&, and || work for control flow.
- if (mkTrue() ? mkTrue() : mkFalse()) {
- Expect.isTrue(true);
- } else {
- Expect.isTrue(false);
- }
- if (mkTrue() ? mkFalse() : mkTrue()) {
- Expect.isTrue(false);
- } else {
- Expect.isTrue(true);
- }
- if (mkFalse() ? mkTrue() : mkFalse()) {
- Expect.isTrue(false);
- } else {
- Expect.isTrue(true);
- }
- if (mkFalse() ? mkFalse() : mkTrue()) {
- Expect.isTrue(true);
- } else {
- Expect.isTrue(false);
- }
- if (mkTrue() && mkTrue()) {
- Expect.isTrue(true);
- } else {
- Expect.isTrue(false);
- }
- if (mkTrue() && mkFalse()) {
- Expect.isTrue(false);
- } else {
- Expect.isTrue(true);
- }
- if (mkFalse() && mkTrue()) {
- Expect.isTrue(false);
- } else {
- Expect.isTrue(true);
- }
- if (mkFalse() && mkFalse()) {
- Expect.isTrue(false);
- } else {
- Expect.isTrue(true);
- }
- if (mkTrue() || mkTrue()) {
- Expect.isTrue(true);
- } else {
- Expect.isTrue(false);
- }
- if (mkTrue() || mkFalse()) {
- Expect.isTrue(true);
- } else {
- Expect.isTrue(false);
- }
- if (mkFalse() || mkTrue()) {
- Expect.isTrue(true);
- } else {
- Expect.isTrue(false);
- }
- if (mkFalse() || mkFalse()) {
- Expect.isTrue(false);
- } else {
- Expect.isTrue(true);
- }
-
- // Test empty else branches.
- if (mkTrue()) {
- Expect.isTrue(true);
- }
- if (mkFalse()) {
- Expect.isTrue(false);
- }
-
- var x = 0;
- if (mkTrue()) {
- x = 1;
- }
- Expect.isTrue(x == 1);
- if (mkFalse()) {
- x = 2;
- }
- Expect.isTrue(x == 1);
-}
diff --git a/tests/kernel/unsorted/constant_evaluator_regression_test.dart b/tests/kernel/unsorted/constant_evaluator_regression_test.dart
deleted file mode 100644
index e5c79c6..0000000
--- a/tests/kernel/unsorted/constant_evaluator_regression_test.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-const X = const bool.fromEnvironment('foobar');
-
-main() {
- Expect.isTrue(X == false);
-}
diff --git a/tests/kernel/unsorted/constant_expressions_test.dart b/tests/kernel/unsorted/constant_expressions_test.dart
deleted file mode 100644
index 2dbec48..0000000
--- a/tests/kernel/unsorted/constant_expressions_test.dart
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-const int42 = 40 + 2;
-const stringAB = 'a' + 'b';
-const stringAB2 = 'a' + 'b';
-const list123 = const [1, 2, 3];
-const mapABC = const {'a': 'b', 'b': 'c'};
-
-const boxInt42 = const Box(int42);
-const boxStringAB = const Box(stringAB);
-
-class Box {
- final value;
- const Box(this.value);
-}
-
-returnPositional([a = const Box('posi' + 'tional')]) => a;
-
-returnNamed({a: const Box('nam' + 'ed')}) => a;
-
-returnSwitchCasedValue(value) {
- switch (value) {
- case const Box(42):
- return 42;
- case const Box('abc'):
- return 'abc';
- case const Box(const Box('abc')):
- return const Box('abc');
- default:
- return 'default';
- }
-}
-
-testConstantExpressions() {
- Expect.isTrue(identical(const Box(40 + 2), const Box(40 + 2)));
- Expect.isTrue(identical(const Box('a' + 'b'), const Box('ab')));
- Expect.isTrue(
- identical(const Box(const Box(40 + 2)), const Box(const Box(42))));
- Expect.isTrue(
- identical(const Box(const Box('a' + 'b')), const Box(const Box('ab'))));
-}
-
-testConstantFieldValues() {
- Expect.isTrue(identical(42, int42));
- Expect.isTrue(identical(stringAB, stringAB2));
- Expect.isTrue(identical(const Box(42), boxInt42));
- Expect.isTrue(identical(const Box('ab'), boxStringAB));
-}
-
-testConstantFunctionParameters() {
- Expect.isTrue(identical(const Box('positional'), returnPositional()));
- Expect.isTrue(identical(const Box('named'), returnNamed()));
- Expect
- .isTrue(identical(const Box('abc'), returnPositional(const Box('abc'))));
- Expect.isTrue(identical(const Box('def'), returnNamed(a: const Box('def'))));
-}
-
-testConstantSwitchExpressions() {
- Expect.isTrue(returnSwitchCasedValue(const Box(42)) == 42);
- Expect.isTrue(returnSwitchCasedValue(const Box('abc')) == 'abc');
- Expect.isTrue(
- returnSwitchCasedValue(const Box(const Box('abc'))) == const Box('abc'));
- Expect
- .isTrue(returnSwitchCasedValue(const Box('go-to-default')) == 'default');
-}
-
-testConstantLocalVariables() {
- const a = 'a';
- const b = a + 'b';
- const c = b + 'c';
- const box = const Box(c);
- Expect.isTrue(identical(const Box('abc'), box));
-}
-
-testComplextConstLiterals() {
- Expect.isTrue(identical(const [1, 2, 3], const [1, 2, 3]));
- Expect.isTrue(identical(const [1, 2, 3], list123));
- Expect.isTrue(
- identical(const {'a': 'b', 'b': 'c'}, const {'a': 'b', 'b': 'c'}));
- Expect.isTrue(identical(const {'a': 'b', 'b': 'c'}, mapABC));
-
- Expect.isTrue(mapABC['a'] == 'b');
- Expect.isTrue(mapABC['b'] == 'c');
- Expect.isTrue(mapABC.length == 2);
-
- Expect.isTrue(list123[0] == 1);
- Expect.isTrue(list123[1] == 2);
- Expect.isTrue(list123[2] == 3);
- Expect.isTrue(list123.length == 3);
-}
-
-main() {
- testConstantExpressions();
- testConstantFieldValues();
- testConstantFunctionParameters();
- testConstantSwitchExpressions();
- testComplextConstLiterals();
- testConstantExpressions();
- testConstantLocalVariables();
-}
diff --git a/tests/kernel/unsorted/factory_regression_test.dart b/tests/kernel/unsorted/factory_regression_test.dart
deleted file mode 100644
index efccf81..0000000
--- a/tests/kernel/unsorted/factory_regression_test.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:typed_data';
-
-import 'package:expect/expect.dart';
-
-var list = [1, 2, 3];
-
-class Foo {
- final value;
- Foo(this.value) {}
-
- factory Foo.fac(value) {
- return new Foo(value);
- }
-}
-
-main() {
- Expect.isTrue(new Uint8List.fromList(list)[1] == 2);
- Expect.isTrue(new Foo.fac(10).value == 10);
-}
diff --git a/tests/kernel/unsorted/field_dispatcher_test.dart b/tests/kernel/unsorted/field_dispatcher_test.dart
deleted file mode 100644
index cddba91..0000000
--- a/tests/kernel/unsorted/field_dispatcher_test.dart
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class A {
- Function fun;
- A(this.fun);
-}
-
-globalFunctionPositional(int a, [int b = 42]) => a + b;
-
-globalFunctionNamed(int a, {int b: 42}) => a + b;
-
-class Foo {
- int base;
-
- Foo(this.base);
-
- methodFunctionPositional(int a, [int b = 42]) => base + a + b;
-
- methodFunctionNamed(int a, {int b: 42}) => base + a + b;
-}
-
-main() {
- Expect.isTrue(new A(globalFunctionPositional).fun(1, 2) == 3);
- Expect.isTrue(new A(globalFunctionPositional).fun(1) == 43);
- Expect.isTrue(new A(globalFunctionNamed).fun(1, b: 2) == 3);
- Expect.isTrue(new A(globalFunctionNamed).fun(1) == 43);
-
- var foo = new Foo(100);
- Expect.isTrue(new A(foo.methodFunctionPositional).fun(1, 2) == 103);
- Expect.isTrue(new A(foo.methodFunctionPositional).fun(1) == 143);
- Expect.isTrue(new A(foo.methodFunctionNamed).fun(1, b: 2) == 103);
- Expect.isTrue(new A(foo.methodFunctionNamed).fun(1) == 143);
-}
diff --git a/tests/kernel/unsorted/finally_contexts_test.dart b/tests/kernel/unsorted/finally_contexts_test.dart
deleted file mode 100644
index 2385916..0000000
--- a/tests/kernel/unsorted/finally_contexts_test.dart
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-// Test that the context depth is correct in the presence of control flow,
-// specifically branching and joining in the presence of break. The
-// implementation uses the context depth after the else block of an if/then/else
-// as the context depth at the join point. This test has an extra context
-// allocated in the (untaken) else branch so it tests that compiling the
-// (untaken) break properly tracks the context depth.
-
-test(list) {
- // The loops force creation of a new context, otherwise context allocated
- // variables might be hoisted to an outer context.
- do {
- if (list.length > 1) {
- do {
- var sum = 0;
- addem() {
- for (var x in list) sum += x;
- }
-
- addem();
- Expect.isTrue(sum == 15);
- L:
- if (sum != 15) {
- // Unreachable.
- do {
- var product = 1;
- multiplyem() {
- for (var x in list) product *= x;
- }
-
- multiplyem();
- Expect.isTrue(false);
- break L;
- } while (false);
- }
- } while (false);
- }
- } while (false);
- Expect.isTrue(list.length == 5);
-}
-
-main() {
- test([1, 2, 3, 4, 5]);
-}
diff --git a/tests/kernel/unsorted/for_in_loop_test.dart b/tests/kernel/unsorted/for_in_loop_test.dart
deleted file mode 100644
index 635d72f..0000000
--- a/tests/kernel/unsorted/for_in_loop_test.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of for-in loops and list literals.
-
-import 'package:expect/expect.dart';
-
-fact4() {
- var f = 1;
- for (var n in [1, 2, 3, 4]) {
- f *= n;
- }
- return f;
-}
-
-fact5() {
- var f = 1, n;
- for (n in [1, 2, 3, 4, 5]) {
- f *= n;
- }
- return f;
-}
-
-var global;
-fact6() {
- var f = 1;
- for (global in [1, 2, 3, 4, 5, 6]) {
- f *= global;
- }
- return f;
-}
-
-main() {
- Expect.isTrue(fact4() == 24);
- Expect.isTrue(fact5() == 120);
- Expect.isTrue(fact6() == 720);
-}
diff --git a/tests/kernel/unsorted/generic_function_test.dart b/tests/kernel/unsorted/generic_function_test.dart
deleted file mode 100644
index 126f863..0000000
--- a/tests/kernel/unsorted/generic_function_test.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of generic functions.
-
-import 'package:expect/expect.dart';
-
-typedef R Foo<R>();
-
-bar<R>(int body()) {
- var function = () {
- if (body is Foo<R>) {
- return body();
- }
- return 42;
- };
- return function();
-}
-
-main() {
- Expect.isTrue(bar(() => 43) == 43);
-}
diff --git a/tests/kernel/unsorted/getters_and_setters_test.dart b/tests/kernel/unsorted/getters_and_setters_test.dart
deleted file mode 100644
index 816a0e0..0000000
--- a/tests/kernel/unsorted/getters_and_setters_test.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-var field;
-
-get getField {
- print('B.getField');
- return field;
-}
-
-set setField(value) {
- print('B.setField');
- field = value;
- return null;
-}
-
-main() {
- var result;
-
- result = (field = 42);
- Expect.isTrue(result == 42);
- Expect.isTrue(field == 42);
- Expect.isTrue(getField == 42);
-
- result = (setField = 99);
- Expect.isTrue(result == 99);
- Expect.isTrue(field == 99);
- Expect.isTrue(getField == 99);
-}
diff --git a/tests/kernel/unsorted/global_field_initializer_test.dart b/tests/kernel/unsorted/global_field_initializer_test.dart
deleted file mode 100644
index a19fe34..0000000
--- a/tests/kernel/unsorted/global_field_initializer_test.dart
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-var intField = 1;
-var doubleField = 3.1415;
-var stringField = "hello";
-var nullField = null;
-var nullField2;
-var composed = "hello" + " " + "world";
-
-class A {
- static var intField = 1;
- static var doubleField = 3.1415;
- static var stringField = "hello";
- static var nullField = null;
- static var nullField2;
- static var composed = "hello" + " " + "world";
-}
-
-main() {
- Expect.isTrue(intField == 1);
- Expect.isTrue(doubleField == 3.1415);
- Expect.isTrue(stringField == "hello");
- Expect.isTrue(nullField == null);
- Expect.isTrue(nullField2 == null);
- Expect.isTrue(composed == "hello world");
-
- Expect.isTrue(A.intField == 1);
- Expect.isTrue(A.doubleField == 3.1415);
- Expect.isTrue(A.stringField == "hello");
- Expect.isTrue(A.nullField == null);
- Expect.isTrue(A.nullField2 == null);
- Expect.isTrue(A.composed == "hello world");
-}
diff --git a/tests/kernel/unsorted/global_function_test.dart b/tests/kernel/unsorted/global_function_test.dart
deleted file mode 100644
index 16ede5f..0000000
--- a/tests/kernel/unsorted/global_function_test.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-main() {
- foo(1, 2);
- print('---');
- foo(1, 2, d: 12);
- print('---');
- foo(1, 2, c: 11, e: 13);
-
- print('=====');
-
- bar(1, 2);
- print('---');
- bar(1, 2, 3);
- print('---');
- bar(1, 2, 3, 4);
-}
-
-foo(a, b, {c, d, e}) {
- print(a);
- print(b);
- print(c);
- print(d);
- print(e);
-}
-
-bar(a, b, [c, d]) {
- print(a);
- print(b);
- print(c);
- print(d);
-}
diff --git a/tests/kernel/unsorted/instance_getters_and_setters_test.dart b/tests/kernel/unsorted/instance_getters_and_setters_test.dart
deleted file mode 100644
index 4430a62..0000000
--- a/tests/kernel/unsorted/instance_getters_and_setters_test.dart
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class A {
- var field;
-
- get getField {
- return field;
- }
-
- set setField(value) {
- field = value;
- return null;
- }
-}
-
-main() {
- var result;
- var a = new A();
-
- Expect.isTrue(a.field == null);
- Expect.isTrue(a.getField == null);
-
- result = (a.field = 42);
- Expect.isTrue(result == 42);
- Expect.isTrue(a.field == 42);
- Expect.isTrue(a.getField == 42);
-
- result = (a.setField = 99);
- Expect.isTrue(result == 99);
- Expect.isTrue(a.field == 99);
- Expect.isTrue(a.getField == 99);
-}
diff --git a/tests/kernel/unsorted/invocation_errors_test.dart b/tests/kernel/unsorted/invocation_errors_test.dart
deleted file mode 100644
index 95e3106..0000000
--- a/tests/kernel/unsorted/invocation_errors_test.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Erroneous cases of invocations.
-
-import 'package:expect/expect.dart';
-
-test0(x) {
- print('test0');
-}
-
-main() {
- test0(0, 1); //# 00: compile-time error
-}
diff --git a/tests/kernel/unsorted/invocation_test.dart b/tests/kernel/unsorted/invocation_test.dart
deleted file mode 100644
index dbf862c..0000000
--- a/tests/kernel/unsorted/invocation_test.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of invocations.
-
-import 'package:expect/expect.dart';
-
-test0(x) {
- Expect.isTrue(x == 'argument0');
- return 'return0';
-}
-
-class C0 {
- static test1(x) {
- Expect.isTrue(x == 'argument1');
- return 'return1';
- }
-}
-
-class C1 {
- test2(x) {
- Expect.isTrue(x == 'argument2');
- return 'return2';
- }
-}
-
-class C2 {
- C2.test3(x) {
- Expect.isTrue(x == 'argument3');
- }
-}
-
-main() {
- Expect.isTrue(test0('argument0') == 'return0');
- Expect.isTrue(C0.test1('argument1') == 'return1');
- Expect.isTrue(new C1().test2('argument2') == 'return2');
- var c = new C2.test3('argument3');
- Expect.isTrue(c is C2);
-}
diff --git a/tests/kernel/unsorted/klass_field_initializer_test.dart b/tests/kernel/unsorted/klass_field_initializer_test.dart
deleted file mode 100644
index 11c51af6..0000000
--- a/tests/kernel/unsorted/klass_field_initializer_test.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class A {
- var intField = 1;
- var doubleField = 3.1415;
- var stringField = "hello";
- var o;
-
- A(this.o);
-}
-
-class B extends A {
- var nullField = null;
- var nullField2;
-
- var n;
- var m;
-
- B(this.n, o)
- : m = "m",
- super(o);
-}
-
-main() {
- var o = new B("n", "o");
- Expect.isTrue(o.intField == 1);
- Expect.isTrue(o.doubleField == 3.1415);
- Expect.isTrue(o.stringField == "hello");
- Expect.isTrue(o.nullField == null);
- Expect.isTrue(o.nullField2 == null);
- Expect.isTrue(o.m == 'm');
- Expect.isTrue(o.n == 'n');
- Expect.isTrue(o.o == 'o');
-}
diff --git a/tests/kernel/unsorted/klass_test.dart b/tests/kernel/unsorted/klass_test.dart
deleted file mode 100644
index 24ef76a..0000000
--- a/tests/kernel/unsorted/klass_test.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-class A {
- A() {
- print("A");
- }
-
- hello() {
- print("A.hello()");
- }
-
- hello1(a) {
- print("A.hello1()");
- print(a);
- }
-
- foo(a, [b]) {
- print("A.foo()");
- print(a);
- print(b);
- }
-
- bar(a, {b}) {
- print("A.bar()");
- print(a);
- print(b);
- }
-}
-
-main() {
- print("before constructor");
- var a = new A();
- print("============");
- a.hello();
- print('-----(obj):');
- print(a);
- print('-----');
- a.hello1(1);
- print('-----');
- a.foo(1);
- print('-----');
- a.foo(1, 2);
- print('-----');
- print("============");
- a.bar(1);
- print('-----');
- a.bar(1, b: 2);
- print("============");
-}
diff --git a/tests/kernel/unsorted/let_test.dart b/tests/kernel/unsorted/let_test.dart
deleted file mode 100644
index 7687966..0000000
--- a/tests/kernel/unsorted/let_test.dart
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-main() {
- var a = [1];
- Expect.isTrue((a..add(42))[1] == 42);
-}
diff --git a/tests/kernel/unsorted/load_store_test.dart b/tests/kernel/unsorted/load_store_test.dart
deleted file mode 100644
index d19f87b..0000000
--- a/tests/kernel/unsorted/load_store_test.dart
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of reading and writing to variables.
-
-import 'package:expect/expect.dart';
-
-test0() {
- var x0 = 0, x1;
- Expect.isTrue(x0 == 0);
- Expect.isTrue(x1 == null);
- x0 = 1;
- Expect.isTrue(x0 == 1);
- Expect.isTrue((x0 = 2) == 2);
- Expect.isTrue(x0 == 2);
-}
-
-var x2 = 0, x3;
-
-test1() {
- Expect.isTrue(x2 == 0);
- Expect.isTrue(x3 == null);
- x2 = 1;
- Expect.isTrue(x2 == 1);
- Expect.isTrue((x2 = 2) == 2);
- Expect.isTrue(x2 == 2);
-}
-
-class C {
- static var x4 = 0;
- static var x5;
-}
-
-test3() {
- Expect.isTrue(C.x4 == 0);
- Expect.isTrue(C.x5 == null);
- C.x4 = 1;
- Expect.isTrue(C.x4 == 1);
- Expect.isTrue((C.x4 = 2) == 2);
- Expect.isTrue(C.x4 == 2);
-}
-
-class D {
- var x6 = 0;
- var x7;
-}
-
-test4() {
- var d = new D();
- Expect.isTrue(d.x6 == 0);
- Expect.isTrue(d.x7 == null);
- d.x6 = 1;
- Expect.isTrue(d.x6 == 1);
- Expect.isTrue((d.x6 = 2) == 2);
- Expect.isTrue(d.x6 == 2);
-}
-
-main() {
- test0();
- test1();
- test3();
- test4();
-}
diff --git a/tests/kernel/unsorted/local_function_test.dart b/tests/kernel/unsorted/local_function_test.dart
deleted file mode 100644
index 536c96a..0000000
--- a/tests/kernel/unsorted/local_function_test.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of function expressions and function statements.
-
-import 'package:expect/expect.dart';
-
-main() {
- var even;
- odd(n) => n > 0 && even(n - 1);
- even = (n) => n == 0 || odd(n - 1);
-
- Expect.isTrue(even(0));
- Expect.isTrue(!odd(0));
-
- Expect.isTrue(odd(1));
- Expect.isTrue(!even(1));
-
- Expect.isTrue(even(42));
- Expect.isTrue(!odd(42));
-
- Expect.isTrue(odd(101));
- Expect.isTrue(!even(101));
-}
diff --git a/tests/kernel/unsorted/loop_test.dart b/tests/kernel/unsorted/loop_test.dart
deleted file mode 100644
index c9b2617..0000000
--- a/tests/kernel/unsorted/loop_test.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of loops.
-
-import 'package:expect/expect.dart';
-
-fact(n) {
- var f = BigInt.one;
- while (n > 1) {
- f *= BigInt.from(n);
- --n;
- }
- return f;
-}
-
-fib(n) {
- if (n == 0) return 0;
- var previous = 0, current = 1;
- while (n > 1) {
- var temp = current;
- current += previous;
- previous = temp;
- --n;
- }
- return current;
-}
-
-mkTrue() => true;
-mkFalse() => false;
-
-check(b) {
- Expect.isTrue(b);
- return b;
-}
-
-test0() {
- while (mkTrue()) {
- Expect.isTrue(true);
- return;
- }
- Expect.isTrue(false);
-}
-
-test1() {
- while (mkFalse()) {
- Expect.isTrue(false);
- }
- Expect.isTrue(true);
-}
-
-test2() {
- do {
- Expect.isTrue(true);
- } while (mkFalse());
- Expect.isTrue(true);
-}
-
-test3() {
- do {
- Expect.isTrue(true);
- return;
- } while (check(false));
- Expect.isTrue(false);
-}
-
-main() {
- Expect.isTrue(fact(0) == BigInt.one);
- Expect.isTrue(fact(1) == BigInt.one);
- Expect.isTrue(fact(5) == BigInt.from(120));
- Expect.isTrue(fact(42) ==
- BigInt.parse("1405006117752879898543142606244511569936384000000000"));
- Expect.isTrue(fact(3.14159) == BigInt.from(6));
-
- Expect.isTrue(fib(0) == 0);
- Expect.isTrue(fib(1) == 1);
- Expect.isTrue(fib(2) == 1);
- Expect.isTrue(fib(3) == 2);
- Expect.isTrue(fib(4) == 3);
- Expect.isTrue(fib(5) == 5);
- Expect.isTrue(fib(6) == 8);
- Expect.isTrue(fib(7) == 13);
- Expect.isTrue(fib(42) == 267914296);
- Expect.isTrue(fib(3.14159) == 3);
-
- test0();
- test1();
- test2();
- test3();
-}
diff --git a/tests/kernel/unsorted/mapliteral_test.dart b/tests/kernel/unsorted/mapliteral_test.dart
deleted file mode 100644
index 9651402..0000000
--- a/tests/kernel/unsorted/mapliteral_test.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-main() {
- var map = {
- 'k1': 'v1',
- 'k2': 'v2',
- 1: 2,
- 1.5: 1.2,
- 3: 3.14,
- };
-
- Expect.isTrue(map.length == 5);
-
- map['foo'] = 'bar';
-
- Expect.isTrue(map['k1'] == 'v1');
- Expect.isTrue(map['k2'] == 'v2');
- Expect.isTrue(map[1] == 2);
- Expect.isTrue(map[1.5] == 1.2);
- Expect.isTrue(map[3] == 3.14);
- Expect.isTrue(map['foo'] == 'bar');
- Expect.isTrue(map.length == 6);
-}
diff --git a/tests/kernel/unsorted/mixin_test.dart b/tests/kernel/unsorted/mixin_test.dart
deleted file mode 100644
index 9c49ee8..0000000
--- a/tests/kernel/unsorted/mixin_test.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class Base {
- baseFoo() {
- print('Base.baseFoo()');
- return 1;
- }
-
- foo() {
- print('Base.foo()');
- return 1;
- }
-}
-
-class Mixin {
- mixinFoo() {
- print('Mixin.mixinFoo()');
- return 2;
- }
-
- foo() {
- print('Mixin.foo()');
- return 2;
- }
-}
-
-class Mixin2 {
- mixin2Foo() {
- print('Mixin2.mixin2Foo()');
- return 3;
- }
-
- foo() {
- print('Mixin2.foo()');
- return 3;
- }
-}
-
-class Sub extends Base with Mixin, Mixin2 {
- subFoo() {
- print('Sub.subFoo()');
- return 4;
- }
-
- foo() {
- print('Sub.foo()');
- return 4;
- }
-}
-
-main() {
- var o = new Sub();
-
- Expect.isTrue(o.baseFoo() == 1);
- Expect.isTrue(o.mixinFoo() == 2);
- Expect.isTrue(o.mixin2Foo() == 3);
- Expect.isTrue(o.subFoo() == 4);
- Expect.isTrue(o.foo() == 4);
-}
diff --git a/tests/kernel/unsorted/nsm_dispatcher_test.dart b/tests/kernel/unsorted/nsm_dispatcher_test.dart
deleted file mode 100644
index 8a0722a..0000000
--- a/tests/kernel/unsorted/nsm_dispatcher_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class A {
- noSuchMethod(Invocation invocation) {
- var s = '|${invocation.memberName}|';
- for (var a in invocation.positionalArguments) {
- s = '$s$a|';
- }
- invocation.namedArguments.forEach((Symbol k, v) {
- s = '$s$k/$v|';
- });
- print(s);
- return s;
- }
-}
-
-main() {
- dynamic o = new A();
- Expect.isTrue(o.fun() == '|${#fun}|');
- Expect.isTrue(o.fun(1) == '|${#fun}|1|');
- Expect.isTrue(o.fun(1, 2) == '|${#fun}|1|2|');
- Expect.isTrue(o.fun(1, b: 2) == '|${#fun}|1|${#b}/2|');
- Expect.isTrue(o.fun(1, a: 1, b: 2) == '|${#fun}|1|${#a}/1|${#b}/2|');
- Expect.isTrue(o.fun(1, b: 2, a: 1) == '|${#fun}|1|${#a}/1|${#b}/2|');
-}
diff --git a/tests/kernel/unsorted/nullable_operator_test.dart b/tests/kernel/unsorted/nullable_operator_test.dart
deleted file mode 100644
index 9bf1bcb7..0000000
--- a/tests/kernel/unsorted/nullable_operator_test.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-mkOne() => 1;
-mkNull() => null;
-
-main() {
- Expect.isTrue((mkOne() ?? 2) == 1);
- Expect.isTrue((mkNull() ?? 2) == 2);
-}
diff --git a/tests/kernel/unsorted/optimize_noncached_constant_test.dart b/tests/kernel/unsorted/optimize_noncached_constant_test.dart
deleted file mode 100644
index 2023293..0000000
--- a/tests/kernel/unsorted/optimize_noncached_constant_test.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=--optimization_counter_threshold=5 --no-background-compilation
-
-void foo(int i) {
- try {
- print(42 ~/ 0 + i);
- } catch (e) {
- return;
- }
- throw "Should have gotten an exception";
-}
-
-main() {
- for (int i = 0; i < 10; ++i) {
- foo(i);
- }
-}
diff --git a/tests/kernel/unsorted/rethrow_test.dart b/tests/kernel/unsorted/rethrow_test.dart
deleted file mode 100644
index c8f31d1..0000000
--- a/tests/kernel/unsorted/rethrow_test.dart
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-testNormalRethrow() {
- var x = 0;
- try {
- try {
- throw x++;
- } catch (e) {
- Expect.isTrue(e == 0);
- x++;
- rethrow;
- }
- } catch (e) {
- Expect.isTrue(e == 0);
- x++;
- }
- Expect.isTrue(x == 3);
-}
-
-testNormalRethrow2() {
- var x = 0;
- try {
- try {
- throw x++;
- } on int catch (e) {
- Expect.isTrue(e == 0);
- x++;
- rethrow;
- }
- } catch (e) {
- Expect.isTrue(e == 0);
- x++;
- }
- Expect.isTrue(x == 3);
-}
-
-testRethrowWithinTryRethrow() {
- var x = 0;
- try {
- try {
- throw x++;
- } on int catch (e) {
- Expect.isTrue(e == 0);
- x++;
- try {
- x++;
- rethrow;
- } finally {
- x++;
- }
- }
- } catch (e) {
- Expect.isTrue(e == 0);
- x++;
- }
- Expect.isTrue(x == 5);
-}
-
-main() {
- testNormalRethrow();
- testNormalRethrow2();
- testRethrowWithinTryRethrow();
-}
diff --git a/tests/kernel/unsorted/return_test.dart b/tests/kernel/unsorted/return_test.dart
deleted file mode 100644
index ebe7e78..0000000
--- a/tests/kernel/unsorted/return_test.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of return (and imports, literals, ==, and static methods).
-
-import 'package:expect/expect.dart';
-
-test0() {}
-
-test1() {
- return;
-}
-
-test3() {
- return 3;
-}
-
-test4() => 4;
-
-test5() {
- return 5;
- Expect.isTrue(false);
-}
-
-main() {
- Expect.isTrue(test0() == null);
- Expect.isTrue(test1() == null);
- Expect.isTrue(test3() == 3);
- Expect.isTrue(test4() == 4);
- Expect.isTrue(test5() == 5);
-}
diff --git a/tests/kernel/unsorted/simple_literal_test.dart b/tests/kernel/unsorted/simple_literal_test.dart
deleted file mode 100644
index c4b8a42..0000000
--- a/tests/kernel/unsorted/simple_literal_test.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Tests of literals (and imports, return, ==, and static methods).
-import 'package:expect/expect.dart';
-
-test0() {
- return 'Hello, world!';
-}
-
-test1() {
- return 42;
-}
-
-test2() {
- return 2.71828;
-}
-
-test3() {
- return 6.022e23;
-}
-
-test4() {
- return true;
-}
-
-test5() {
- return false;
-}
-
-test6() {
- return 1405006117752879898543142606244511569936384000000000; //# 01: compile-time error
-}
-
-main() {
- Expect.isTrue(test0() == 'Hello, world!');
- Expect.isTrue(test1() == 42);
- Expect.isTrue(test2() == 2.71828);
- Expect.isTrue(test3() == 6.022e23);
- Expect.isTrue(test4());
- Expect.isTrue(test5() == false);
- Expect.isTrue(test6() == // //# 01: continued
- 1405006117752879898543142606244511569936384000000000); //# 01: continued
-}
diff --git a/tests/kernel/unsorted/string_buffer_test.dart b/tests/kernel/unsorted/string_buffer_test.dart
deleted file mode 100644
index a89aee6..0000000
--- a/tests/kernel/unsorted/string_buffer_test.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-main() {
- var sb = new StringBuffer();
- sb.writeln('hello world :)');
- print(sb);
-}
diff --git a/tests/kernel/unsorted/string_concatenation_test.dart b/tests/kernel/unsorted/string_concatenation_test.dart
deleted file mode 100644
index be6543a..0000000
--- a/tests/kernel/unsorted/string_concatenation_test.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class A {
- toString() => 'hello';
-}
-
-main() {
- Expect.isTrue('begin ${new A()} end' == 'begin hello end');
-}
diff --git a/tests/kernel/unsorted/super_mixin_test.dart b/tests/kernel/unsorted/super_mixin_test.dart
deleted file mode 100644
index f70b888..0000000
--- a/tests/kernel/unsorted/super_mixin_test.dart
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class BaseMixin {
- method(x) {
- print(x);
- return x + 'error';
- }
-
- set setter(x) {
- print(x);
- }
-}
-
-class Base {
- var field;
-
- method(x) {
- print(x);
- return x;
- }
-
- set setter(x) {
- print(x);
- field = x;
- }
-}
-
-class Mixin extends BaseMixin {
- method(x) {
- return super.method(x + 'Mixin');
- }
-
- set setter(x) {
- super.setter = x + 'Mixin';
- }
-}
-
-class Sub extends Base with Mixin {}
-
-main() {
- var object = new Sub();
- Expect.isTrue(object.method('x') == 'xMixin');
- object.setter = 'y';
- Expect.isTrue(object.field == 'yMixin');
-}
diff --git a/tests/kernel/unsorted/super_test.dart b/tests/kernel/unsorted/super_test.dart
deleted file mode 100644
index 54f5d99..0000000
--- a/tests/kernel/unsorted/super_test.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class A {
- var field = 9;
- var called = false;
-
- superMethod() {
- Expect.isTrue(field == 10);
- called = true;
- return true;
- }
-}
-
-class B extends A {
- doit() {
- Expect.isTrue((super.field = 10) == 10);
- Expect.isTrue(super.superMethod());
- if (called) {
- Expect.isTrue((super.field = 11) == 11);
- }
- return super.field;
- }
-}
-
-class C extends B {
- set field(v) {
- throw 'should not happen';
- }
-}
-
-main() {
- var c = new C();
- Expect.isTrue(c.field == 9);
- Expect.isTrue(c.doit() == 11);
- Expect.isTrue(c.field == 11);
-}
diff --git a/tests/kernel/unsorted/superclass_test.dart b/tests/kernel/unsorted/superclass_test.dart
deleted file mode 100644
index 15f1f56..0000000
--- a/tests/kernel/unsorted/superclass_test.dart
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class A {
- A() {
- print("A");
- }
-
- hello() {
- print("A.hello()");
- return 1;
- }
-
- hello1(a) {
- print("A.hello1()");
- print(a);
- return 1;
- }
-
- foo(a, [b]) {
- print("A.foo()");
- print(a);
- print(b);
- return 1;
- }
-
- bar(a, {b}) {
- print("A.bar()");
- print(a);
- print(b);
- return 1;
- }
-}
-
-class B extends A {
- hello() {
- print("B.hello()");
- return 2;
- }
-
- bar(a, {b}) {
- print("B.bar()");
- print(a);
- print(b);
- return 2;
- }
-}
-
-main() {
- var o = new B();
-
- // Base class methods.
- Expect.isTrue(o.hello1(1) == 1);
- Expect.isTrue(o.foo(1) == 1);
- Expect.isTrue(o.foo(1, 2) == 1);
-
- // Overwritten methods.
- Expect.isTrue(o.hello() == 2);
- Expect.isTrue(o.bar(1) == 2);
- Expect.isTrue(o.bar(1, b: 2) == 2);
-}
diff --git a/tests/kernel/unsorted/switch_case_test.dart b/tests/kernel/unsorted/switch_case_test.dart
deleted file mode 100644
index 509a373..0000000
--- a/tests/kernel/unsorted/switch_case_test.dart
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-mkOne() => 1;
-mkTwo() => 2;
-
-testNormal() {
- int result;
- switch (mkOne()) {
- case 0:
- result = 0;
- break;
- case 1:
- result = 1;
- break;
- case 2:
- result = 2;
- break;
- default:
- result = 3;
- break;
- }
- Expect.isTrue(result == 1);
-}
-
-testDefault() {
- int result;
- switch (null) {
- case 0:
- result = 0;
- break;
- case 1:
- result = 1;
- break;
- case 2:
- result = 2;
- break;
- default:
- result = 3;
- break;
- }
- Expect.isTrue(result == 3);
-}
-
-testFallThrough() {
- int result;
- switch (mkOne()) {
- case 0:
- result = 0;
- break;
- case 1:
- case 2:
- result = 2;
- break;
- default:
- result = 3;
- break;
- }
- Expect.isTrue(result == 2);
-}
-
-testContinue() {
- int result;
- switch (mkTwo()) {
- case 0:
- result = 0;
- break;
-
- setitto1:
- case 1:
- result = 1;
- continue setitto3;
-
- case 2:
- result = 2;
- continue setitto1;
-
- setitto3:
- default:
- result = 3;
- break;
- }
- Expect.isTrue(result == 3);
-}
-
-testOnlyDefault() {
- int result;
- switch (mkTwo()) {
- default:
- result = 42;
- }
- Expect.isTrue(result == 42);
-}
-
-testOnlyDefaultWithBreak() {
- int result;
- switch (mkTwo()) {
- default:
- result = 42;
- }
- Expect.isTrue(result == 42);
-}
-
-String testReturn() {
- switch (mkOne()) {
- case 0:
- return "bad";
- case 1:
- return "good";
- default:
- return "bad";
- }
-}
-
-regressionTest() {
- Expect.isTrue(regressionTestHelper(0, 0) == -1);
- Expect.isTrue(regressionTestHelper(4, 0) == -1);
- Expect.isTrue(regressionTestHelper(4, 1) == 42);
-}
-
-regressionTestHelper(i, j) {
- switch (i) {
- case 4:
- switch (j) {
- case 1:
- return 42;
- }
- }
- return -1;
-}
-
-regressionTest2() {
- var state = 1;
- while (state < 2) {
- switch (state) {
- case 1:
- state++;
- break;
- case 3:
- case 4:
- // We will translate this currently to an empty [Fragment] which can
- // cause issues if we would like to append/prepend to it.
- assert(false);
- }
- }
- return [1];
-}
-
-regressionTest3() {
- f(x) {
- switch (x) {
- case 1:
- return 2;
- case 2:
- }
- throw new UnsupportedError("Unexpected constant kind.");
- }
-
- Expect.isTrue(f(1) == 2);
-}
-
-main() {
- testNormal();
- testDefault();
- testFallThrough();
- testContinue();
- testOnlyDefault();
- testOnlyDefaultWithBreak();
- regressionTest();
- regressionTest2();
- regressionTest3();
-
- var result = testReturn();
- Expect.isTrue(result == "good");
-}
diff --git a/tests/kernel/unsorted/symbol_literal_test.dart b/tests/kernel/unsorted/symbol_literal_test.dart
deleted file mode 100644
index 6a3cc8a..0000000
--- a/tests/kernel/unsorted/symbol_literal_test.dart
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-main() {
- Expect.isTrue('${#abc}' == 'Symbol("abc")');
- Expect.isTrue('${#abc.xzy}' == 'Symbol("abc.xzy")');
-}
diff --git a/tests/kernel/unsorted/this_capture_test.dart b/tests/kernel/unsorted/this_capture_test.dart
deleted file mode 100644
index ea296d6..0000000
--- a/tests/kernel/unsorted/this_capture_test.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class Foo {
- capture() {
- return () {
- return this;
- };
- }
-
- captureFirst(a, b) {
- return () {
- print(a);
- return this;
- };
- }
-
- captureLast(a, b) {
- return () {
- print(b);
- return this;
- };
- }
-}
-
-main() {
- var foo = new Foo();
- Expect.isTrue(identical(foo, (foo.capture())()));
- Expect.isTrue(identical(foo, (foo.captureFirst(1, 2))()));
- Expect.isTrue(identical(foo, (foo.captureLast(1, 2))()));
-}
diff --git a/tests/kernel/unsorted/this_test.dart b/tests/kernel/unsorted/this_test.dart
deleted file mode 100644
index 666da97..0000000
--- a/tests/kernel/unsorted/this_test.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class A {
- getThis() => this;
-}
-
-main() {
- var a = new A();
- Expect.isTrue(a == a.getThis());
- Expect.isTrue(identical(a, a.getThis()));
-}
diff --git a/tests/kernel/unsorted/throw_try_catch_test.dart b/tests/kernel/unsorted/throw_try_catch_test.dart
deleted file mode 100644
index d76cba7..0000000
--- a/tests/kernel/unsorted/throw_try_catch_test.dart
+++ /dev/null
@@ -1,190 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-testSimpleThrowCatch() {
- var x = 1;
- try {
- throw x++;
- } on int catch (e) {
- Expect.isTrue(e == 1);
- Expect.isTrue(x == 2);
- x++;
- }
- Expect.isTrue(x == 3);
-}
-
-testNestedThrowCatch() {
- var x = 1;
- try {
- throw x++;
- } catch (e) {
- Expect.isTrue(e == 1);
- Expect.isTrue(x == 2);
- x++;
-
- try {
- throw x++;
- } catch (e) {
- Expect.isTrue(e == 3);
- Expect.isTrue(x == 4);
- x++;
- }
- }
- Expect.isTrue(x == 5);
-}
-
-testNestedThrowCatch2() {
- var x = 1;
- try {
- try {
- throw x++;
- } catch (e) {
- Expect.isTrue(e == 1);
- Expect.isTrue(x == 2);
- x++;
- }
- throw x++;
- } catch (e) {
- Expect.isTrue(e == 3);
- Expect.isTrue(x == 4);
- x++;
- }
- Expect.isTrue(x == 5);
-}
-
-testSiblingThrowCatch() {
- var x = 1;
- try {
- throw x++;
- } catch (e) {
- Expect.isTrue(e == 1);
- Expect.isTrue(x == 2);
- x++;
- }
- try {
- throw x++;
- } catch (e) {
- Expect.isTrue(e == 3);
- Expect.isTrue(x == 4);
- x++;
- }
-
- Expect.isTrue(x == 5);
-}
-
-testTypedCatch() {
- var good = false;
- try {
- throw 1;
- } on int catch (e) {
- Expect.isTrue(e == 1);
- good = true;
- } on String catch (_) {
- Expect.isTrue(false);
- }
- Expect.isTrue(good);
-}
-
-testTypedCatch2() {
- var good = false;
- try {
- throw 'a';
- } on int catch (_) {
- Expect.isTrue(false);
- } on String catch (e) {
- Expect.isTrue(e == 'a');
- good = true;
- }
- Expect.isTrue(good);
-}
-
-testThrowNull() {
- var good = false;
- try {
- throw null;
- } on NullThrownError catch (_) {
- good = true;
- }
- Expect.isTrue(good);
-}
-
-testFinally() {
- var x = 0;
- try {
- throw x++;
- } catch (_) {
- x++;
- } finally {
- x++;
- }
- Expect.isTrue(x == 3);
-}
-
-testFinally2() {
- var x = 0;
- try {
- try {
- throw x++;
- } catch (_) {
- x++;
- } finally {
- x++;
- }
- } finally {
- x++;
- }
- Expect.isTrue(x == 4);
-}
-
-testFinally3() {
- try {
- var x = 0;
- try {
- throw x++;
- } finally {
- x++;
- }
- Expect.isTrue(x == 2);
- } catch (_) {}
-}
-
-testSuccessfulBody() {
- var x = 0;
- try {
- x++;
- } finally {
- x++;
- }
- Expect.isTrue(x == 2);
-}
-
-testSuccessfulBody2() {
- var x = 0;
- try {
- try {
- x++;
- } finally {
- x++;
- throw 1;
- }
- } on int {}
- Expect.isTrue(x == 2);
-}
-
-main() {
- testSimpleThrowCatch();
- testNestedThrowCatch();
- testNestedThrowCatch2();
- testSiblingThrowCatch();
- testTypedCatch();
- testTypedCatch2();
- testThrowNull();
- testFinally();
- testFinally2();
- testFinally3();
- testSuccessfulBody();
- testSuccessfulBody2();
-}
diff --git a/tests/kernel/unsorted/try_context_test.dart b/tests/kernel/unsorted/try_context_test.dart
deleted file mode 100644
index 0676f41..0000000
--- a/tests/kernel/unsorted/try_context_test.dart
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-throwValue(val) => throw val;
-
-f1() {
- var a = 0;
- var b = 0;
- var c = 0;
- var d = 0;
- for (var i = 0; i < 10; i++) {
- try {
- for (var j = 0; j < 11; j++) {
- try {
- capture() => [i, j, a, b, c, d];
- throwValue(j == 10 ? "${j}" : j);
- } on num catch (e) {
- a += j;
- b -= e;
- }
- }
- } catch (e) {
- c++;
- d += int.parse(e);
- }
- }
- return [a, b, c, d];
-}
-
-f2() {
- var a = 0;
- var b = 0;
- var c = 0;
- var d = 0;
- for (var i = 0; i < 10; i++) {
- try {
- for (var j = 0; j < 11; j++) {
- try {
- capture() => [i, j, a, b, c, d];
- throwValue(j == 10 ? "${j}" : j);
- } on num catch (e) {
- a += j;
- b -= e;
- }
- }
- } catch (e) {
- capture() => e;
- c++;
- d += int.parse(e);
- }
- }
- return [a, b, c, d];
-}
-
-f3() {
- var a = 0;
- var b = 0;
- var c = 0;
- var d = 0;
- for (var i = 0; i < 10; i++) {
- try {
- for (var j = 0; j < 11; j++) {
- try {
- capture() => [i, j, a, b, c, d];
- throwValue(j == 10 ? "${j}" : j);
- } on num catch (e) {
- a += j;
- b -= e;
- }
- }
- } catch (e) {
- capture() => e;
- c++;
- d += int.parse(e);
- continue;
- }
- }
- return [a, b, c, d];
-}
-
-main() {
- Expect.listEquals([450, -450, 10, 100], f1());
- Expect.listEquals([450, -450, 10, 100], f2());
- Expect.listEquals([450, -450, 10, 100], f3());
-}
diff --git a/tests/kernel/unsorted/try_finally_test.dart b/tests/kernel/unsorted/try_finally_test.dart
deleted file mode 100644
index 91ccf58..0000000
--- a/tests/kernel/unsorted/try_finally_test.dart
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-testSimpleBreak() {
- var x = 1;
- while (true) {
- try {
- x++;
- break;
- } finally {
- x++;
- break;
- }
- }
- return x;
-}
-
-testReturnFinally() {
- try {
- return 1;
- } finally {
- return 42;
- }
-}
-
-testNestedReturnFinally() {
- try {
- try {
- return 1;
- } finally {
- return 2;
- }
- } finally {
- return 42;
- }
-}
-
-testReturnInsideLoop() {
- while (true) {
- try {
- print("hello");
- } finally {
- return 42;
- }
- }
-}
-
-testStopContinueInsideLoop() {
- while (true) {
- try {
- continue;
- } finally {
- return 42;
- }
- }
-}
-
-testStopBreakInsideLoop() {
- var foo = 1;
- while (true) {
- try {
- if (foo == 1) {
- // 1st iteration we break.
- break;
- } else if (foo == 2) {
- // 2nd iteration we return.
- return 42;
- }
- } finally {
- // 1st iteration we overrwrite break with continue.
- if (foo == 1) {
- foo++;
- continue;
- } else {
- // Let return work
- }
- }
- }
- return foo;
-}
-
-testStopBreakInsideLoop2() {
- var foo = 1;
- while (true) {
- try {
- if (foo == 1) {
- // 1st iteration we break.
- break;
- } else if (foo == 2) {
- // 2nd iteration we return.
- return -1;
- }
- } finally {
- // 1st iteration we overrwrite break with continue.
- if (foo == 1) {
- foo++;
- continue;
- } else {
- // 2nd iteration we overrwrite return with break.
- foo = 42;
- break;
- }
- }
- }
- return foo;
-}
-
-testStopContinueInsideSwitch() {
- var foo = 1;
- switch (foo) {
- jump5:
- case 5:
- return -1;
-
- case 1:
- try {
- continue jump5;
- } finally {
- return 42;
- }
- }
-}
-
-testStopContinueInsideSwitch2() {
- var foo = 1;
- switch (foo) {
- jump5:
- case 5:
- return -1;
-
- jump42:
- case 5:
- return 42;
-
- case 1:
- try {
- continue jump5;
- } finally {
- continue jump42;
- }
- }
-}
-
-testNestedFinally() {
- var events = '';
- try {
- try {
- events = '$events|start';
- } finally {
- events = '$events|start-catch';
- }
- try {
- try {
- return;
- } finally {
- events = '$events|inner';
- throw 0;
- }
- } finally {
- events = '$events|middle';
- }
- } catch (e) {
- events = '$events|outer-catch';
- } finally {
- events = '$events|outer-finally';
- }
- Expect.equals(
- events, '|start|start-catch|inner|middle|outer-catch|outer-finally');
-}
-
-main() {
- Expect.isTrue(testSimpleBreak() == 3);
- Expect.isTrue(testReturnFinally() == 42);
- Expect.isTrue(testNestedReturnFinally() == 42);
- Expect.isTrue(testReturnInsideLoop() == 42);
- Expect.isTrue(testStopContinueInsideLoop() == 42);
- Expect.isTrue(testStopBreakInsideLoop() == 42);
- Expect.isTrue(testStopBreakInsideLoop2() == 42);
- Expect.isTrue(testStopContinueInsideLoop() == 42);
- Expect.isTrue(testStopContinueInsideSwitch() == 42);
- Expect.isTrue(testStopContinueInsideSwitch2() == 42);
- testNestedFinally();
-}
diff --git a/tests/kernel/unsorted/type_args_regression_test.dart b/tests/kernel/unsorted/type_args_regression_test.dart
deleted file mode 100644
index 0b88bd7..0000000
--- a/tests/kernel/unsorted/type_args_regression_test.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class Box<T> {
- T value;
-
- Box(this.value);
-
- factory Box.a(T v) => new Box(v);
- factory Box.b(T v) = Box<T>;
- factory Box.c(T v) => new Box(v);
-}
-
-main() {
- Expect.isTrue(new Box<int>(1).value == 1);
- Expect.isTrue(new Box<int>.a(1).value == 1);
- Expect.isTrue(new Box<int>.b(1).value == 1);
- Expect.isTrue(new Box<int>.c(1).value == 1);
-}
diff --git a/tests/kernel/unsorted/types_test.dart b/tests/kernel/unsorted/types_test.dart
deleted file mode 100644
index 0b989a1..0000000
--- a/tests/kernel/unsorted/types_test.dart
+++ /dev/null
@@ -1,214 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-class TypeTester<T> {
- const TypeTester();
- bool isCorrectType(object) => object is T;
-}
-
-class ClosureTypeTester<T> {
- const ClosureTypeTester();
- bool isCorrectType(object) => (() => object is T)();
-}
-
-class Base<A, B> {
- final A a;
- final B b;
- const Base(this.a, this.b);
- const factory Base.fac(A a, B b) = Base<A, B>;
-}
-
-class Sub1<C, D> extends Base<C, C> {
- final D d;
- const Sub1(C a, this.d) : super(a, a);
- const factory Sub1.fac(C a, D d) = Sub1<C, D>;
-}
-
-class Sub2<C, D> extends Base<D, C> {
- const Sub2(C a, D b) : super(b, a);
- const factory Sub2.fac(C a, D b) = Sub2<C, D>;
-}
-
-class G<T> {}
-
-class I {}
-
-class A implements I {}
-
-class B extends A {}
-
-class C {}
-
-testConstantLiteralTypes() {
- Expect.isTrue(const [1] is List);
- Expect.isTrue(const [1] is List<int>);
- Expect.isTrue(const ["1"] is List<String>);
- Expect.isTrue(!(const [1] is List<String>));
- Expect.isTrue(const <int>[1] is List);
- Expect.isTrue(const <int>[1] is List<int>);
- Expect.isTrue(!(const <int>[1] is List<String>));
- Expect.isTrue(const {"a": 1} is Map);
- Expect.isTrue(const {"a": 1} is Map<String, int>);
- Expect.isTrue(const {1: "a"} is Map<int, String>);
- Expect.isTrue(const <String, int>{"a": 1} is Map);
- Expect.isTrue(const <String, int>{"a": 1} is Map<String, int>);
- Expect.isTrue(!(const <String, int>{"a": 1} is Map<int, String>));
-}
-
-testNonConstantLiteralTypes() {
- Expect.isTrue([1] is List);
- Expect.isTrue([1] is List<int>);
- Expect.isTrue(["1"] is List<String>);
- Expect.isTrue(!([1] is List<String>));
- Expect.isTrue(<int>[1] is List);
- Expect.isTrue(<int>[1] is List<int>);
- Expect.isTrue(!(<int>[1] is List<String>));
-}
-
-testParametrizedClass() {
- Expect.isTrue(new Base<int, int>(1, 1) is Base<int, int>);
- Expect.isTrue(new Base<int, int>(1, 1) is Base);
- Expect.isTrue(new Base<int, int>(1, 1) is Base<Object, Object>);
- Expect.isTrue(!(new Base<int, int>(1, 1) is Base<int, String>));
- Expect.isTrue(!(new Base<int, int>(1, 1) is Base<String, int>));
- Expect.isTrue(new Sub1<int, String>(1, "1") is Base<int, int>);
- Expect.isTrue(new Sub1<int, String>(1, "1") is Base);
- Expect.isTrue(new Sub1<int, String>(1, "1") is Sub1<int, String>);
- Expect.isTrue(new Sub1<int, String>(1, "1") is Sub1);
- Expect.isTrue(!(new Sub1<int, String>(1, "1") is Base<String, int>));
- Expect.isTrue(!(new Sub1<int, String>(1, "1") is Base<int, String>));
- Expect.isTrue(!(new Sub1<int, String>(1, "1") is Sub1<String, String>));
- Expect.isTrue(new Sub2<int, String>(1, "1") is Base<String, int>);
- Expect.isTrue(new Sub2<int, String>(1, "1") is Base);
- Expect.isTrue(new Sub2<int, String>(1, "1") is Sub2<int, String>);
- Expect.isTrue(new Sub2<int, String>(1, "1") is Sub2);
- Expect.isTrue(!(new Sub2<int, String>(1, "1") is Base<int, int>));
- Expect.isTrue(!(new Sub2<int, String>(1, "1") is Base<int, String>));
- Expect.isTrue(!(new Sub2<int, String>(1, "1") is Sub2<String, String>));
-}
-
-testTypeTester() {
- Expect.isTrue(new TypeTester<int>().isCorrectType(10));
- Expect.isTrue(!new TypeTester<int>().isCorrectType("abc"));
- Expect.isTrue(new TypeTester<List<int>>().isCorrectType([1]));
- Expect.isTrue(new TypeTester<List<int>>().isCorrectType(<int>[1]));
- Expect.isTrue(!new TypeTester<List<int>>().isCorrectType(<String>["1"]));
- Expect.isTrue(new TypeTester<Base<String, int>>()
- .isCorrectType(new Sub2<int, String>(1, "1")));
- Expect.isTrue(new TypeTester<Sub2<int, String>>()
- .isCorrectType(new Sub2<int, String>(1, "1")));
-}
-
-testClosureTypeTester() {
- Expect.isTrue(new ClosureTypeTester<int>().isCorrectType(10));
- Expect.isTrue(!new ClosureTypeTester<int>().isCorrectType("abc"));
- Expect.isTrue(new ClosureTypeTester<List<int>>().isCorrectType([1]));
- Expect.isTrue(new ClosureTypeTester<List<int>>().isCorrectType(<int>[1]));
- Expect
- .isTrue(!new ClosureTypeTester<List<int>>().isCorrectType(<String>["1"]));
- Expect.isTrue(new ClosureTypeTester<Base<String, int>>()
- .isCorrectType(new Sub2<int, String>(1, "1")));
- Expect.isTrue(new ClosureTypeTester<Sub2<int, String>>()
- .isCorrectType(new Sub2<int, String>(1, "1")));
-}
-
-testConstTypeArguments() {
- Expect.isTrue(const Sub1<int, String>(1, "1") is Sub1<int, String>);
- Expect.isTrue(const Sub1<int, String>.fac(1, "1") is Sub1<int, String>);
- Expect.isTrue(!(const Sub1<int, String>(1, "1") is Sub1<String, String>));
- Expect.isTrue(!(const Sub1<int, String>.fac(1, "1") is Sub1<String, String>));
-
- Expect.isTrue(const ClosureTypeTester<List<Base<int, String>>>()
- .isCorrectType(
- const <Base<int, String>>[const Base<int, String>(1, "2")]));
- Expect.isTrue(const ClosureTypeTester<List<Base<int, String>>>()
- .isCorrectType(
- const <Base<int, String>>[const Base<int, String>.fac(1, "2")]));
- Expect.isTrue(!const ClosureTypeTester<List<Base<int, String>>>()
- .isCorrectType(
- const <Base<String, String>>[const Base<String, String>("1", "2")]));
- Expect.isTrue(!const ClosureTypeTester<List<Base<int, String>>>()
- .isCorrectType(const <Base<String, String>>[
- const Base<String, String>.fac("1", "2")
- ]));
-
- Expect.isTrue(const TypeTester<Sub2<int, String>>()
- .isCorrectType(const Sub2<int, String>(1, "1")));
- Expect.isTrue(const TypeTester<Sub2<int, String>>()
- .isCorrectType(const Sub2<int, String>.fac(1, "1")));
- Expect.isTrue(!const TypeTester<Sub2<int, String>>()
- .isCorrectType(const Sub2<String, String>("a", "b")));
- Expect.isTrue(!const TypeTester<Sub2<int, String>>()
- .isCorrectType(const Sub2<String, String>.fac("a", "b")));
-}
-
-testNoBound() {
- new G<int>();
- new G<num>();
- new G<Function>();
- new G<Object>();
- new G();
- new G();
- new G<G>();
-}
-
-testSubtypeChecker() {
- Expect.isTrue(new TypeTester<num>().isCorrectType(1));
- Expect.isTrue(new TypeTester<num>().isCorrectType(1.0));
- Expect.isTrue(new TypeTester<A>().isCorrectType(new B()));
- Expect.isTrue(new TypeTester<Object>().isCorrectType(new C()));
- Expect.isTrue(new TypeTester<I>().isCorrectType(new A()));
-}
-
-testFunctionTypes() {
- fun(int x, String y) => "${x}${y}";
- Expect.isTrue(!(fun is FunctionType));
-
- fun1(num x, Pattern y) => 123;
- Expect.isTrue(fun1 is FunctionType);
-
- fun2(num x, String y) => 123;
- Expect.isTrue(!(fun2 is FunctionType));
-
- Expect.isTrue(!(nan is FunctionType));
- Expect.isTrue(nan is Function);
-}
-
-num nan(double d, Pattern p) => double.nan;
-
-typedef int FunctionType(num _, Pattern __);
-
-testLiteralTypeArguments() {
- Expect.isTrue(new Foo<String, int>().foo() is List<String>);
- Expect.isTrue(new Foo<int, String>().bar() is Map<int, String>);
-}
-
-class Foo<T1, T2> {
- foo() => <T1>[];
- bar() => <T1, T2>{};
-}
-
-regressionTest1() {
- Expect.isTrue(!StaticTypeTester.isInt('abc'));
-}
-
-class StaticTypeTester<T> {
- static isInt(x) => x is int;
-}
-
-main() {
- testConstantLiteralTypes();
- testNonConstantLiteralTypes();
- testParametrizedClass();
- testTypeTester();
- testClosureTypeTester();
- testConstTypeArguments();
- testNoBound();
- testSubtypeChecker();
- testFunctionTypes();
- testLiteralTypeArguments();
- regressionTest1();
-}
diff --git a/tools/VERSION b/tools/VERSION
index 328d6ef..f534ec5 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 10
PATCH 0
-PRERELEASE 151
+PRERELEASE 152
PRERELEASE_PATCH 0
\ No newline at end of file