Migrate language/arithmetic2_test ... language/async_await_syntax_test.

R=sra@google.com

Review-Url: https://codereview.chromium.org/2990773002 .
This commit is contained in:
Bob Nystrom 2017-07-27 16:13:46 -07:00
parent 557cab2a3e
commit 23952fdf56
47 changed files with 431 additions and 1561 deletions

View file

@ -1,7 +1,6 @@
// Copyright (c) 2015, 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.
// SharedOptions=--assert-message
import "package:expect/expect.dart";

View file

@ -1,73 +0,0 @@
// Copyright (c) 2012, 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.
// Dart test program to test arithmetic operations.
import "package:expect/expect.dart";
class A {
static foo() => 499;
}
bool throwsNoSuchMethod(f) {
try {
f();
return false;
} on NoSuchMethodError catch (e) {
return true;
}
return false;
}
bool throwsBecauseOfBadArgument(f) {
try {
f();
return false;
} on NoSuchMethodError catch (e) {
return true;
} on ArgumentError catch (e) {
return true;
} on TypeError catch (e) {
// In type checked mode.
return true;
}
return false;
}
numberOpBadSecondArgument(f) {
Expect.isTrue(throwsBecauseOfBadArgument(() => f(true)));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(new A())));
Expect.isTrue(throwsBecauseOfBadArgument(() => f("foo")));
Expect.isTrue(throwsBecauseOfBadArgument(() => f("5")));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(() => 499)));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(null)));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(false)));
Expect.isTrue(throwsBecauseOfBadArgument(() => f([])));
Expect.isTrue(throwsBecauseOfBadArgument(() => f({})));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(A.foo)));
}
badOperations(b) {
Expect.isTrue(throwsNoSuchMethod(() => b - 3));
Expect.isTrue(throwsNoSuchMethod(() => b * 3));
Expect.isTrue(throwsNoSuchMethod(() => b ~/ 3));
Expect.isTrue(throwsNoSuchMethod(() => b / 3));
Expect.isTrue(throwsNoSuchMethod(() => b % 3));
Expect.isTrue(throwsNoSuchMethod(() => b + 3));
Expect.isTrue(throwsNoSuchMethod(() => b[3]));
Expect.isTrue(throwsNoSuchMethod(() => ~b));
Expect.isTrue(throwsNoSuchMethod(() => -b));
}
main() {
numberOpBadSecondArgument((x) => 3 + x);
numberOpBadSecondArgument((x) => 3 - x);
numberOpBadSecondArgument((x) => 3 * x);
numberOpBadSecondArgument((x) => 3 / x);
numberOpBadSecondArgument((x) => 3 ~/ x);
numberOpBadSecondArgument((x) => 3 % x);
badOperations(true);
badOperations(false);
badOperations(() => 499);
badOperations(A.foo);
}

View file

@ -1,228 +0,0 @@
// Copyright (c) 2011, 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=--assert_initializer
import "package:expect/expect.dart";
bool assertsEnabled = false;
main() {
assert((assertsEnabled = true));
runtimeAsserts(); // //# none: ok
// Passing const expressions.
const c00 = const AssertArgument.constFirst(true, 0, 1);
const c01 = const AssertArgument.constLast(true, 0, 1);
const c02 = const AssertArgument.constMiddle(true, 0, 1);
const c03 = const AssertArgument.constMulti(true, 0, 1);
const c04 = const AssertArgument.constFirstSuper(true, 0, 1);
const c05 = const AssertArgument.constLastSuper(true, 0, 1);
const c06 = const AssertArgument.constMiddleSuper(true, 0, 1);
const c07 = const AssertArgument.constMultiSuper(true, 0, 1);
const c08 = const AssertCompare.constFirst(1, 2);
const c09 = const AssertCompare.constLast(1, 2);
const c10 = const AssertCompare.constMiddle(1, 2);
const c11 = const AssertCompare.constMulti(1, 2);
const c12 = const AssertCompare.constFirstSuper(1, 2);
const c13 = const AssertCompare.constLastSuper(1, 2);
const c14 = const AssertCompare.constMiddleSuper(1, 2);
const c15 = const AssertCompare.constMultiSuper(1, 2);
// Failing const expressions
const c = const AssertArgument.constFirst(false, 0, 1); // //# 01: checked mode compile-time error
const c = const AssertArgument.constLast(false, 0, 1); // //# 02: checked mode compile-time error
const c = const AssertArgument.constMiddle(false, 0, 1); // //# 03: checked mode compile-time error
const c = const AssertArgument.constMulti(false, 0, 1); // //# 04: checked mode compile-time error
const c = const AssertArgument.constFirstSuper(false, 0, 1); // //# 05: checked mode compile-time error
const c = const AssertArgument.constLastSuper(false, 0, 1); // //# 06: checked mode compile-time error
const c = const AssertArgument.constMiddleSuper(false, 0, 1); // //# 07: checked mode compile-time error
const c = const AssertArgument.constMultiSuper(false, 0, 1); // //# 08: checked mode compile-time error
const c = const AssertArgument.constFirst("str", 0, 1); // //# 11: checked mode compile-time error
const c = const AssertArgument.constLast("str", 0, 1); // //# 12: checked mode compile-time error
const c = const AssertArgument.constMiddle("str", 0, 1); // //# 13: checked mode compile-time error
const c = const AssertArgument.constMulti("str", 0, 1); // //# 14: checked mode compile-time error
const c = const AssertArgument.constFirstSuper("str", 0, 1); // //# 15: checked mode compile-time error
const c = const AssertArgument.constLastSuper("str", 0, 1); // //# 16: checked mode compile-time error
const c = const AssertArgument.constMiddleSuper("str", 0, 1); // //# 17: checked mode compile-time error
const c = const AssertArgument.constMultiSuper("str", 0, 1); // //# 18: checked mode compile-time error
const c = const AssertCompare.constFirst(3, 2); // //# 21: checked mode compile-time error
const c = const AssertCompare.constLast(3, 2); // //# 22: checked mode compile-time error
const c = const AssertCompare.constMiddle(3, 2); // //# 23: checked mode compile-time error
const c = const AssertCompare.constMulti(3, 2); // //# 24: checked mode compile-time error
const c = const AssertCompare.constFirstSuper(3, 2); // //# 25: checked mode compile-time error
const c = const AssertCompare.constLastSuper(3, 2); // //# 26: checked mode compile-time error
const c = const AssertCompare.constMiddleSuper(3, 2); // //# 27: checked mode compile-time error
const c = const AssertCompare.constMultiSuper(3, 2); // //# 28: checked mode compile-time error
// Functions not allowed in asserts in const execution.
const c = const AssertArgument.constFirst(kTrue, 0, 1); // //# 31: checked mode compile-time error
const c = const AssertArgument.constLast(kTrue, 0, 1); // //# 32: checked mode compile-time error
const c = const AssertArgument.constMiddle(kTrue, 0, 1); // //# 33: checked mode compile-time error
const c = const AssertArgument.constMulti(kTrue, 0, 1); // //# 34: checked mode compile-time error
const c = const AssertArgument.constFirstSuper(kTrue, 0, 1); // //# 35: checked mode compile-time error
const c = const AssertArgument.constLastSuper(kTrue, 0, 1); // //# 36: checked mode compile-time error
const c = const AssertArgument.constMiddleSuper(kTrue, 0, 1); // //# 37: checked mode compile-time error
const c = const AssertArgument.constMultiSuper(kTrue, 0, 1); // //# 38: checked mode compile-time error
const cTrue = const TrickCompare(true);
// Value must be integer for potential-const expression to be actually const.
const c = const AssertCompare.constFirst(cTrue, 2); // //# 41: checked mode compile-time error
const c = const AssertCompare.constLast(cTrue, 2); // //# 42: checked mode compile-time error
const c = const AssertCompare.constMiddle(cTrue, 2); // //# 43: checked mode compile-time error
const c = const AssertCompare.constMulti(cTrue, 2); // //# 44: checked mode compile-time error
const c = const AssertCompare.constFirstSuper(cTrue, 2); // //# 45: checked mode compile-time error
const c = const AssertCompare.constLastSuper(cTrue, 2); // //# 46: checked mode compile-time error
const c = const AssertCompare.constMiddleSuper(cTrue, 2); // //# 47: checked mode compile-time error
const c = const AssertCompare.constMultiSuper(cTrue, 2); // //# 48: checked mode compile-time error
}
void runtimeAsserts() {
testAssertArgumentCombinations(value, test, [testConst]) {
test(() => new AssertArgument.first(value, 0, 1));
test(() => new AssertArgument.last(value, 0, 1));
test(() => new AssertArgument.middle(value, 0, 1));
test(() => new AssertArgument.multi(value, 0, 1));
test(() => new AssertArgument.firstSuper(value, 0, 1));
test(() => new AssertArgument.lastSuper(value, 0, 1));
test(() => new AssertArgument.middleSuper(value, 0, 1));
test(() => new AssertArgument.multiSuper(value, 0, 1));
testConst ??= test;
testConst(() => new AssertArgument.constFirst(value, 0, 1));
testConst(() => new AssertArgument.constLast(value, 0, 1));
testConst(() => new AssertArgument.constMiddle(value, 0, 1));
testConst(() => new AssertArgument.constMulti(value, 0, 1));
testConst(() => new AssertArgument.constFirstSuper(value, 0, 1));
testConst(() => new AssertArgument.constLastSuper(value, 0, 1));
testConst(() => new AssertArgument.constMiddleSuper(value, 0, 1));
testConst(() => new AssertArgument.constMultiSuper(value, 0, 1));
}
testAssertCompareCombinations(v1, v2, test, [testConst]) {
test(() => new AssertCompare.first(v1, v2));
test(() => new AssertCompare.last(v1, v2));
test(() => new AssertCompare.middle(v1, v2));
test(() => new AssertCompare.multi(v1, v2));
test(() => new AssertCompare.firstSuper(v1, v2));
test(() => new AssertCompare.lastSuper(v1, v2));
test(() => new AssertCompare.middleSuper(v1, v2));
test(() => new AssertCompare.multiSuper(v1, v2));
testConst ??= test;
testConst(() => new AssertCompare.constFirst(v1, v2));
testConst(() => new AssertCompare.constLast(v1, v2));
testConst(() => new AssertCompare.constMiddle(v1, v2));
testConst(() => new AssertCompare.constMulti(v1, v2));
testConst(() => new AssertCompare.constFirstSuper(v1, v2));
testConst(() => new AssertCompare.constLastSuper(v1, v2));
testConst(() => new AssertCompare.constMiddleSuper(v1, v2));
testConst(() => new AssertCompare.constMultiSuper(v1, v2));
}
testAssertArgumentCombinations(true, pass);
testAssertArgumentCombinations(kTrue, pass, failType);
testAssertArgumentCombinations(false, failAssert);
testAssertArgumentCombinations(kFalse, failAssert, failType);
testAssertArgumentCombinations(42, failType);
testAssertArgumentCombinations(null, failAssert);
testAssertCompareCombinations(1, 2, pass);
testAssertCompareCombinations(3, 2, failAssert);
var TrickCompareInt = const TrickCompare(42);
testAssertCompareCombinations(TrickCompareInt, 0, failType);
var TrickCompareTrueFun = const TrickCompare(kTrue);
testAssertCompareCombinations(TrickCompareTrueFun, 0, pass, failType);
var TrickCompareFalseFun = const TrickCompare(kFalse);
testAssertCompareCombinations(TrickCompareFalseFun, 0, failAssert, failType);
}
void pass(void action()) {
action();
}
void failAssert(void action()) {
if (assertsEnabled) {
Expect.throws(action, (e) => e is AssertionError && e is! TypeError);
} else {
action();
}
}
void failType(void action()) {
if (assertsEnabled) {
Expect.throws(action, (e) => e is TypeError);
} else {
action();
}
}
bool kTrue() => true;
bool kFalse() => false;
class AssertArgument {
final y;
final z;
AssertArgument.first(x, y, z) : assert(x), y = y, z = z;
AssertArgument.last(x, y, z) : y = y, z = z, assert(x);
AssertArgument.middle(x, y, z) : y = y, assert(x), z = z;
AssertArgument.multi(x, y, z)
: assert(x), y = y, assert(x), z = z, assert(x);
AssertArgument.firstSuper(x, y, z) : assert(x), y = y, z = z, super();
AssertArgument.lastSuper(x, y, z) : y = y, z = z, assert(x), super();
AssertArgument.middleSuper(x, y, z) : y = y, assert(x), z = z, super();
AssertArgument.multiSuper(x, y, z)
: assert(x), y = y, assert(x), z = z, assert(x), super();
const AssertArgument.constFirst(x, y, z) : assert(x), y = y, z = z;
const AssertArgument.constLast(x, y, z) : y = y, z = z, assert(x);
const AssertArgument.constMiddle(x, y, z) : y = y, assert(x), z = z;
const AssertArgument.constMulti(x, y, z)
: assert(x), y = y, assert(x), z = z, assert(x);
const AssertArgument.constFirstSuper(x, y, z)
: assert(x), y = y, z = z, super();
const AssertArgument.constLastSuper(x, y, z)
: y = y, z = z, assert(x), super();
const AssertArgument.constMiddleSuper(x, y, z)
: y = y, assert(x), z = z, super();
const AssertArgument.constMultiSuper(x, y, z)
: assert(x), y = y, assert(x), z = z, assert(x), super();
}
class AssertCompare {
final y;
final z;
AssertCompare.first(y, z) : assert(y < z), y = y, z = z;
AssertCompare.last(y, z) : y = y, z = z, assert(y < z);
AssertCompare.middle(y, z) : y = y, assert(y < z), z = z;
AssertCompare.multi(y, z)
: assert(y < z), y = y, assert(y < z), z = z, assert(y < z);
AssertCompare.firstSuper(y, z) : assert(y < z), y = y, z = z, super();
AssertCompare.lastSuper(y, z) : y = y, z = z, assert(y < z), super();
AssertCompare.middleSuper(y, z) : y = y, assert(y < z), z = z, super();
AssertCompare.multiSuper(y, z)
: assert(y < z), y = y, assert(y < z), z = z, assert(y < z), super();
const AssertCompare.constFirst(y, z) : assert(y < z), y = y, z = z;
const AssertCompare.constLast(y, z) : y = y, z = z, assert(y < z);
const AssertCompare.constMiddle(y, z) : y = y, assert(y < z), z = z;
const AssertCompare.constMulti(y, z)
: assert(y < z), y = y, assert(y < z), z = z, assert(y < z);
const AssertCompare.constFirstSuper(y, z)
: assert(y < z), y = y, z = z, super();
const AssertCompare.constLastSuper(y, z)
: y = y, z = z, assert(y < z), super();
const AssertCompare.constMiddleSuper(y, z)
: y = y, assert(y < z), z = z, super();
const AssertCompare.constMultiSuper(y, z)
: assert(y < z), y = y, assert(y < z), z = z, assert(y < z), super();
}
class TrickCompare {
final result;
const TrickCompare(this.result);
operator<(other) => result; // Nyah-nyah!
}

View file

@ -1,77 +0,0 @@
// Copyright (c) 2011, 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=--enable_asserts
//
// Dart test program testing assert statements.
import "package:expect/expect.dart";
class AssertionTest {
static testTrue() {
int i = 0;
try {
assert(true);
} on AssertionError catch (error) {
i = 1;
}
return i;
}
static testFalse() {
int i = 0;
try {
assert(false);
} on AssertionError catch (error) {
i = 1;
}
return i;
}
static unknown(var a) {
return (a) ? true : false;
}
static testUnknown() {
var x = unknown(false);
int i = 0;
try {
assert(x);
} on AssertionError catch (error) {
i = 1;
}
return i;
}
static testClosure() {
int i = 0;
try {
assert(() => false);
} on AssertionError catch (error) {
i = 1;
}
return i;
}
static testClosure2() {
int i = 0;
try {
var x = () => false;
assert(x);
} on AssertionError catch (error) {
i = 1;
}
return i;
}
static testMain() {
Expect.equals(0, testTrue());
Expect.equals(1, testFalse());
Expect.equals(1, testClosure());
Expect.equals(1, testClosure2());
}
}
main() {
AssertionTest.testMain();
}

View file

@ -1,18 +0,0 @@
// Copyright (c) 2011, 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() {}
imethod() {
return 0;
}
}
main() {
var a = new A();
// Illegal, can't change a member method
a.imethod = () {
return 1;
};
}

View file

@ -1,33 +0,0 @@
// Copyright (c) 2012, 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.
// This test insures that statically initialized variables, fields, and parameters
// report static type warnings.
int a = "String"; // //# 01: static type warning, dynamic type error
class A {
static const int c = "String"; //# 02: static type warning, checked mode compile-time error
final int d = "String"; //# 03: static type warning, dynamic type error
int e = "String"; //# 04: static type warning, dynamic type error
A() {
int f = "String"; //# 05: static type warning, dynamic type error
}
method(
[
int // //# 06: static type warning
g = "String"]) {
return g;
}
}
int main() {
var w = a; //# 01: continued
var x;
x = A.c; // //# 02: continued
var v = new A();
x = v.d; // //# 03: continued
x = v.e; // //# 04: continued
x = v.method(1); //# 06: continued
}

View file

@ -1,29 +0,0 @@
// Copyright (c) 2015, 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.
// Verify that an attempt to assign to a class, enum, typedef, or type
// parameter produces a static warning and runtime error.
import "package:expect/expect.dart";
noMethod(e) => e is NoSuchMethodError;
class C<T> {
f() {
Expect.throws(() => T = null, noMethod); //# 01: static type warning
}
}
class D {}
enum E { e0 }
typedef void F();
main() {
new C<D>().f();
Expect.throws(() => D = null, noMethod); //# 02: static type warning
Expect.throws(() => E = null, noMethod); //# 03: static type warning
Expect.throws(() => F = null, noMethod); //# 04: static type warning
}

View file

@ -1,15 +0,0 @@
// Copyright (c) 2012, 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";
method() {
return 0;
}
main() {
// Illegal, can't change a top level method
Expect.throws(() { method = () { return 1; }; }, // //# 01: static type warning
(e) => e is NoSuchMethodError); // //# 01: continued
}

View file

@ -1,44 +0,0 @@
// Copyright (c) 2013, 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.
// Test to detect syntactically illegal left-hand-side (assignable)
// expressions.
class C {
static var static_field = 0;
}
var tl_static_var = 0;
main() {
tl_static_var = 0;
(tl_static_var) = 0; // //# 01: compile-time error
(tl_static_var)++; // //# 02: compile-time error
++(tl_static_var); // //# 03: compile-time error
C.static_field = 0;
(C.static_field) = 0; // //# 11: compile-time error
(C.static_field)++; // //# 12: compile-time error
++(C.static_field); // //# 13: compile-time error
tl_static_var = [1, 2, 3];
tl_static_var[0] = 0;
(tl_static_var)[0] = 0;
(tl_static_var[0]) = 0; // //# 21: compile-time error
(tl_static_var[0])++; // //# 22: compile-time error
++(tl_static_var[0]); // //# 23: compile-time error
C.static_field = [1, 2, 3];
(C.static_field[0]) = 0; // //# 31: compile-time error
(C.static_field[0])++; // //# 32: compile-time error
++(C.static_field[0]); // //# 33: compile-time error
var a = 0;
(a) = 0; // //# 41: compile-time error
(a)++; // //# 42: compile-time error
++(a); // //# 43: compile-time error
// Neat palindrome expression. x is assignable, ((x)) is not.
var funcnuf = (x) => ((x))=((x)) <= (x); // //# 50: compile-time error
}

View file

@ -11,43 +11,6 @@
[$compiler == precompiler && $runtime == dart_precompiled ]
stacktrace_demangle_ctors_test: RuntimeError
[$compiler == precompiler && $runtime == dart_precompiled && !$checked]
assertion_initializer_const_error2_test/cc01: Pass, OK
assertion_initializer_const_error2_test/cc02: CompileTimeError
assertion_initializer_const_error2_test/cc03: Pass, OK
assertion_initializer_const_error2_test/cc04: Pass, OK
assertion_initializer_const_error2_test/cc05: Pass, OK
assertion_initializer_const_error2_test/cc06: Pass, OK
assertion_initializer_const_error2_test/cc07: Pass, OK
assertion_initializer_const_error2_test/cc08: Pass, OK
assertion_initializer_const_error2_test/cc09: Pass, OK
assertion_initializer_const_error2_test/cc10: Pass, OK
assertion_initializer_const_error2_test/cc11: Pass, OK
assertion_initializer_const_error2_test/none: CompileTimeError
[$compiler == precompiler && $runtime == dart_precompiled && $checked]
assertion_initializer_const_error2_test/cc01: Pass
assertion_initializer_const_error2_test/cc03: Pass
assertion_initializer_const_error2_test/cc04: Pass
assertion_initializer_const_error2_test/cc05: Pass
assertion_initializer_const_error2_test/cc06: Pass
assertion_initializer_const_error2_test/cc07: Pass
assertion_initializer_const_error2_test/cc08: Pass
assertion_initializer_const_error2_test/cc09: Pass
assertion_initializer_const_error2_test/cc10: Pass
assertion_initializer_const_error2_test/cc11: Pass
assertion_initializer_const_error2_test/none: CompileTimeError
[$compiler == none && $runtime == vm && !$checked]
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
assertion_initializer_const_error_test/01: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
[$compiler == app_jit && $runtime == vm && !$checked]
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
assertion_initializer_const_error_test/01: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
[ ($runtime == vm || $runtime == flutter || $runtime == dart_precompiled) && $compiler != dartk && $compiler != dartkp ]
abstract_beats_arguments2_test/01: Crash # Issue 29171
@ -133,28 +96,11 @@ vm/unaligned_float_access_literal_index_test: Pass, Crash # Unaligned offset. Is
[ ($compiler == none || $compiler == precompiler || $compiler == app_jit) && (($runtime == vm || $runtime == dart_precompiled)) && $arch == ia32 ]
vm/regress_24517_test: Pass, Fail # Issue 24517.
[ $compiler == precompiler && $runtime == dart_precompiled ]
assertion_initializer_const_error2_test/cc01: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc02: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc03: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc04: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc05: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc06: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc07: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc08: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc09: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc10: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc11: Crash, MissingCompileTimeError
vm/regress_27671_test: Skip # Unsupported
export_double_same_main_test: Skip # Issue 29895
export_ambiguous_main_negative_test: Skip # Issue 29895
vm/optimized_stacktrace_test: Skip # Issue 30198
[ $compiler == precompiler && $runtime == dart_precompiled && !$checked]
assertion_initializer_const_error_test/01: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
[ $compiler == precompiler && $runtime == dart_precompiled && $mode == debug ]
regress_29025_test: Crash # Issue dartbug.com/29331
@ -216,7 +162,6 @@ vm/type_cast_vm_test: RuntimeError # Expects line and column numbers
[ $mode == product ]
issue13474_test: SkipByDesign # Requires checked mode.
assertion_test: SkipByDesign # Requires checked mode.
named_parameters_type_test/01: SkipByDesign # Requires checked mode.
named_parameters_type_test/02: SkipByDesign # Requires checked mode.
named_parameters_type_test/03: SkipByDesign # Requires checked mode.
@ -291,14 +236,6 @@ conditional_import_string_test: Crash # Requires deferred libraries
vm/regress_27201_test: Pass, Crash # Requires deferred libraries
vm/optimized_stacktrace_test: Pass, Slow
[ ($runtime != vm && $compiler != dartk && $compiler != dartkp ) || ($compiler != none && $compiler != dartk && $compiler != dartkp )]
assert_initializer_test/*: SKIP # not implemented yet, experiment is VM only.
[($runtime == vm || $runtime == flutter) && $compiler == none && $checked]
# The VM doesn't enforce that potentially const expressions are actually
# const expressions when the constructor is called with `const`.
assert_initializer_test/4*: MissingCompileTimeError # Issue 392.
[($runtime == vm || $runtime == flutter) && $compiler == none]
duplicate_part_test/01: MissingCompileTimeError # Issue 27516
@ -331,9 +268,6 @@ syntax_test/none: CompileTimeError # Issue #30176.
await_backwards_compatibility_test/none: CompileTimeError
await_test: CompileTimeError
async_await_test: CompileTimeError
async_await_syntax_test/a05c: CompileTimeError
async_await_syntax_test/a05e: CompileTimeError
async_await_syntax_test/d08c: CompileTimeError
static_initializer_type_error_test: CompileTimeError
new_expression_type_args_test/02: CompileTimeError
super_getter_setter_test: CompileTimeError

View file

@ -453,8 +453,3 @@ part_refers_to_core_library_test/01: MissingCompileTimeError # Issue 29709
[ $compiler == dart2analyzer && $builder_tag == strong ]
*: Skip # Issue 28649
[$compiler == dart2analyzer && $runtime == none]
assertion_initializer_const_error2_test/none: CompileTimeError
assertion_initializer_const_function_test/01: CompileTimeError
assertion_initializer_test: CompileTimeError

View file

@ -7,7 +7,6 @@
vm/*: Skip # Issue 12699
[ $compiler == dart2js && ! $dart2js_with_kernel ]
assert_trailing_comma_test/none: CompileTimeError # Issue 29959
enum_test: Fail # Issue 28340
regress_28341_test: Fail # Issue 28340
regress_29349_test: CompileTimeError # Issue 29745
@ -48,19 +47,6 @@ generic_function_typedef2_test/06: Crash # Issue 28214
stacktrace_demangle_ctors_test: Fail # dart2js stack traces are not always compliant.
assertion_initializer_const_error2_test/cc01: Crash
assertion_initializer_const_error2_test/cc02: Crash
assertion_initializer_const_error2_test/cc03: Crash
assertion_initializer_const_error2_test/cc04: Crash
assertion_initializer_const_error2_test/cc05: Crash
assertion_initializer_const_error2_test/cc06: Crash
assertion_initializer_const_error2_test/cc07: Crash
assertion_initializer_const_error2_test/cc08: Crash
assertion_initializer_const_error2_test/cc09: Crash
assertion_initializer_const_function_error_test/01: Crash
assertion_initializer_const_function_test/01: CompileTimeError
assertion_initializer_test: Crash
generalized_void_syntax_test: CompileTimeError # Issue #30176.
syntax_test/none: CompileTimeError # Issue #30176.
@ -196,9 +182,6 @@ positional_parameters_type_test/01: MissingRuntimeError, OK
positional_parameters_type_test/02: MissingRuntimeError, OK
issue13474_test: RuntimeError, OK
[ $compiler == dart2js && ! $checked && ! $enable_asserts && ! $dart2js_with_kernel ]
assertion_test: RuntimeError # Issue 12748
[ $compiler == dart2js && ! $checked && $enable_asserts && ! $dart2js_with_kernel ]
bool_check_test: RuntimeError # Issue 29647
@ -308,20 +291,6 @@ switch_case_warn_test: SKIP # Analyzer only, see language_analyzer2.status
[ $compiler == dart2js && $dart2js_with_kernel_in_ssa ]
constants_test/01: Crash
abstract_beats_arguments_test: RuntimeError # Issue 27394
abstract_runtime_error_test/01: RuntimeError # Issue 27394
abstract_runtime_error_test/02: RuntimeError # Issue 27394
arithmetic_canonicalization_test: RuntimeError # Issue 27394
assertion_initializer_const_error_test/01: Crash
assertion_initializer_const_function_test/01: Crash
assign_top_method_test/01: Crash # Issue 27394
async_await_syntax_test/a04b: Crash # Issue 27394
async_await_syntax_test/a06a: RuntimeError # Issue 27394
async_await_syntax_test/a07b: Crash # Issue 27394
async_await_syntax_test/a08b: Crash # Issue 27394
async_await_syntax_test/b06a: RuntimeError # Issue 27394
async_await_syntax_test/c06a: RuntimeError # Issue 27394
async_await_syntax_test/d06a: RuntimeError # Issue 27394
async_await_test: RuntimeError # Issue 27394
async_star_test: RuntimeError # Issue 27394
await_for_test: RuntimeError # Issue 27394
@ -544,9 +513,6 @@ function_type/function_type99_test: Crash # Issue 27394
generic_function_typedef_test: Crash # Issue 27394
getter_setter_in_lib_test: Crash # Issue 27394
[ $compiler == dart2js && $runtime == d8 && $checked && $dart2js_with_kernel_in_ssa && ! $dart2js_with_kernel ]
assertion_initializer_const_function_test/none: RuntimeError
[ $compiler == dart2js && $dart2js_with_kernel_in_ssa && $host_checked && ! $dart2js_with_kernel ]
conditional_method_invocation_test/02: Crash # Issue 27394
conditional_method_invocation_test/04: Crash # Issue 27394
@ -572,82 +538,6 @@ named_parameters_test/07: Crash # Issue 27394
named_parameters_test/09: Crash # Issue 27394
[ $compiler == dart2js && $runtime == d8 && $dart2js_with_kernel ]
abstract_method_test: Crash
abstract_object_method_test: Crash
abstract_runtime_error_test/01: Crash
abstract_runtime_error_test/02: Crash
arg_param_trailing_comma_test/none: Crash
arithmetic2_test: Crash
arithmetic_test: Crash
assert_message_test: Crash
assert_trailing_comma_test/none: CompileTimeError
assertion_initializer_const_error2_test/cc02: Crash
assertion_initializer_const_error2_test/none: CompileTimeError
assertion_initializer_const_function_error_test/01: Crash
assertion_initializer_test: CompileTimeError
assertion_test: Crash
assign_to_type_test/01: Crash
assign_to_type_test/02: Crash
assign_to_type_test/03: Crash
assign_to_type_test/04: Crash
assign_top_method_test/01: Crash
async_and_or_test: Crash
async_await_catch_regression_test: Crash
async_await_syntax_test/a01a: Crash
async_await_syntax_test/a02a: Crash
async_await_syntax_test/a03a: Crash
async_await_syntax_test/a03b: Crash
async_await_syntax_test/a04a: RuntimeError
async_await_syntax_test/a04c: RuntimeError
async_await_syntax_test/a05a: Crash
async_await_syntax_test/a05b: Crash
async_await_syntax_test/a05c: Crash
async_await_syntax_test/a05e: Crash
async_await_syntax_test/a06a: Crash
async_await_syntax_test/a07a: RuntimeError
async_await_syntax_test/a08a: RuntimeError
async_await_syntax_test/a09a: Crash
async_await_syntax_test/a10a: Crash
async_await_syntax_test/a11b: RuntimeError
async_await_syntax_test/a11c: Crash
async_await_syntax_test/a11d: Crash
async_await_syntax_test/a12g: Crash
async_await_syntax_test/b01a: Crash
async_await_syntax_test/b02a: Crash
async_await_syntax_test/b03a: Crash
async_await_syntax_test/b04a: RuntimeError
async_await_syntax_test/b05a: Crash
async_await_syntax_test/b06a: Crash
async_await_syntax_test/b07a: RuntimeError
async_await_syntax_test/b08a: RuntimeError
async_await_syntax_test/b09a: Crash
async_await_syntax_test/b10a: Crash
async_await_syntax_test/b11b: RuntimeError
async_await_syntax_test/b11c: Crash
async_await_syntax_test/b11d: Crash
async_await_syntax_test/b12g: Crash
async_await_syntax_test/c01a: Crash
async_await_syntax_test/c02a: Crash
async_await_syntax_test/c03a: Crash
async_await_syntax_test/c04a: Crash
async_await_syntax_test/c05a: Crash
async_await_syntax_test/c06a: Crash
async_await_syntax_test/c07a: Crash
async_await_syntax_test/c08a: Crash
async_await_syntax_test/c09a: Crash
async_await_syntax_test/c10a: Crash
async_await_syntax_test/d01a: Crash
async_await_syntax_test/d02a: Crash
async_await_syntax_test/d03a: Crash
async_await_syntax_test/d04a: RuntimeError
async_await_syntax_test/d05a: Crash
async_await_syntax_test/d06a: Crash
async_await_syntax_test/d07a: RuntimeError
async_await_syntax_test/d08a: RuntimeError
async_await_syntax_test/d08b: RuntimeError
async_await_syntax_test/d08c: RuntimeError
async_await_syntax_test/d09a: Crash
async_await_syntax_test/d10a: Crash
async_await_test: Crash
async_star_test: Crash
async_switch_test/none: Crash
@ -2156,13 +2046,6 @@ void_type_test: Crash
yieldstar_pause_test: Crash
[ $compiler == dart2js && $runtime == d8 && $dart2js_with_kernel && $host_checked ]
assertion_initializer_const_function_test/01: Crash
assign_instance_method_negative_test: Crash
async_await_syntax_test/d04a: Crash
async_await_syntax_test/d07a: Crash
async_await_syntax_test/d08a: Crash
async_await_syntax_test/d08b: Crash
async_await_syntax_test/d08c: Crash
bad_override_test/04: Crash
bailout3_test: Crash
bailout5_test: Crash
@ -2458,35 +2341,6 @@ wrong_number_type_arguments_test/00: Crash
wrong_number_type_arguments_test/02: Crash
[ $compiler == dart2js && $runtime == d8 && $dart2js_with_kernel && $minified ]
assert_assignable_type_test: Crash
assert_with_type_test_or_cast_test: Crash
assertion_initializer_const_error_test/none: Crash
assertion_initializer_const_function_error_test/none: Crash
assertion_initializer_const_function_test/01: Crash
assertion_initializer_const_function_test/none: Crash
assign_instance_method_negative_test: Crash
assign_op_test: Crash
assign_static_type_test/03: Crash
assign_static_type_test/04: Crash
assignable_expression_test/none: Crash
async_await_syntax_test/a04a: Crash
async_await_syntax_test/a04c: Crash
async_await_syntax_test/a07a: Crash
async_await_syntax_test/a08a: Crash
async_await_syntax_test/a11b: Crash
async_await_syntax_test/b04a: Crash
async_await_syntax_test/b07a: Crash
async_await_syntax_test/b08a: Crash
async_await_syntax_test/b11b: Crash
async_await_syntax_test/b13a: Crash
async_await_syntax_test/b13c: Crash
async_await_syntax_test/b14a: Crash
async_await_syntax_test/b14c: Crash
async_await_syntax_test/d04a: Crash
async_await_syntax_test/d07a: Crash
async_await_syntax_test/d08a: Crash
async_await_syntax_test/d08b: Crash
async_await_syntax_test/d08c: Crash
bad_constructor_test/05: Crash
bad_constructor_test/none: Crash
bad_override_test/01: Crash

View file

@ -2,34 +2,6 @@
# 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 == dartk && $runtime == vm]
assertion_initializer_const_error2_test/none: CompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
assertion_initializer_test: CompileTimeError
[$compiler == dartk && $runtime == vm && !$checked]
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
[$compiler == dartk && $runtime == vm && $checked]
assertion_initializer_const_function_test/01: RuntimeError
[$compiler == dartkp && $runtime == dart_precompiled]
assertion_initializer_const_error2_test/none: CompileTimeError
[$compiler == dartkp && $runtime == dart_precompiled && !$checked]
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
assertion_initializer_test: CompileTimeError
[$compiler == dartkp && $runtime == dart_precompiled && $checked]
assertion_initializer_const_error2_test/cc02: Crash
assertion_initializer_const_error_test/none: Crash
assertion_initializer_const_function_error_test/01: Crash
assertion_initializer_const_function_error_test/none: Crash
assertion_initializer_const_function_test/01: Crash
assertion_initializer_const_function_test/none: Crash
assertion_initializer_test: CompileTimeError
[ !$checked && ($compiler == dartk || $compiler == dartkp) ]
deferred_constraints_type_annotation_test/type_annotation1: CompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 28335.
@ -37,7 +9,6 @@ deferred_constraints_type_annotation_test/type_annotation_generic1: CompileTimeE
deferred_constraints_type_annotation_test/type_annotation_generic4: CompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 28335.
[ $compiler == dartk || $compiler == dartkp ]
assert_trailing_comma_test/none: CompileTimeError # Issue 29959
method_override_test: RuntimeError # Not triaged.
cha_deopt1_test: CompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 28335.
@ -257,24 +228,6 @@ regress_23498_test: Crash
# dartk: checked mode failures
[ $checked && ($compiler == dartk || $compiler == dartkp) ]
assert_initializer_test/31: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/32: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/33: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/34: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/35: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/36: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/37: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/38: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/41: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/42: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/43: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/44: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/45: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/46: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/47: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/48: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/none: RuntimeError # KernelVM bug: Constant evaluation.
assign_static_type_test/02: MissingCompileTimeError
async_await_test: RuntimeError
compile_time_constant_checked_test/02: MissingCompileTimeError
const_constructor2_test/20: MissingCompileTimeError

View file

@ -2,13 +2,13 @@
// 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.
// SharedOptions=--assert-message
import "dart:async";
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
// TODO(rnystrom): Unify with assert_with_message_test.dart.
main() {
// Only run with asserts enabled mode.
bool assertsEnabled = false;

View file

@ -85,10 +85,10 @@ main() {
}
void test(int x, int y) {
bool checkedMode = false;
assert(checkedMode = true);
bool assertionsEnabled = false;
assert(assertionsEnabled = true);
bool Function(C Function()) doTest = (checkedMode && x >= y)
bool Function(C Function()) doTest = (assertionsEnabled && x >= y)
? (f) { Expect.throws(f, (e) => e is AssertionError); }
: (f) { Expect.equals(x, f().x); };

View file

@ -1,8 +1,8 @@
// Copyright (c) 2011, 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=--enable_type_checks
//
// VMOptions=--enable_type_checks --enable_asserts
// Dart test program testing assert statements.
import "package:expect/expect.dart";

View file

@ -2,6 +2,8 @@
// 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() {}
imethod() {
@ -10,9 +12,12 @@ class A {
}
main() {
var a = new A();
// Illegal, can't change a member method
a.imethod = () {
return 1;
};
dynamic a = new A();
// Illegal, can't change a member method.
Expect.throws(() {
a.imethod = () {
return 1;
};
});
}

View file

@ -0,0 +1,25 @@
// Copyright (c) 2012, 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.
// This test insures that statically initialized variables, fields, and parameters
// report compile-time errors.
int a = "String"; //# 01: compile-time error
class A {
static const int c = "String"; //# 02: compile-time error
final int d = "String"; //# 03: compile-time error
int e = "String"; //# 04: compile-time error
A() {
int f = "String"; //# 05: compile-time error
}
method(
[
int //# 06: compile-time error
g = "String"]) {
return g;
}
}
main() {}

View file

@ -0,0 +1,25 @@
// Copyright (c) 2015, 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.
// Verify that an attempt to assign to a class, enum, typedef, or type
// parameter produces a compile error.
class C<T> {
f() {
T = null; //# 01: compile-time error
}
}
class D {}
enum E { e0 }
typedef void F();
main() {
new C<D>().f();
D = null; //# 02: compile-time error
E = null; //# 03: compile-time error
F = null; //# 04: compile-time error
}

View file

@ -10,6 +10,5 @@ method() {
main() {
// Illegal, can't change a top level method
Expect.throws(() { method = () { return 1; }; }, //# 01: static type warning
(e) => e is NoSuchMethodError); // //# 01: continued
/*@compile-error=unspecified*/ method = () { return 1; };
}

View file

@ -0,0 +1,44 @@
// Copyright (c) 2013, 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.
// Test to detect syntactically illegal left-hand-side (assignable)
// expressions.
class C {
static dynamic field = 0;
}
dynamic variable = 0;
main() {
variable = 0;
(variable) = 0; // //# 01: compile-time error
(variable)++; // //# 02: compile-time error
++(variable); // //# 03: compile-time error
C.field = 0;
(C.field) = 0; // //# 11: compile-time error
(C.field)++; // //# 12: compile-time error
++(C.field); // //# 13: compile-time error
variable = [1, 2, 3];
variable[0] = 0;
(variable)[0] = 0;
(variable[0]) = 0; // //# 21: compile-time error
(variable[0])++; // //# 22: compile-time error
++(variable[0]); // //# 23: compile-time error
C.field = [1, 2, 3];
(C.field[0]) = 0; // //# 31: compile-time error
(C.field[0])++; // //# 32: compile-time error
++(C.field[0]); // //# 33: compile-time error
var a = 0;
(a) = 0; // //# 41: compile-time error
(a)++; // //# 42: compile-time error
++(a); // //# 43: compile-time error
// Neat palindrome expression. x is assignable, ((x)) is not.
var funcnuf = (x) => ((x))=((x)) <= (x); // //# 50: compile-time error
}

View file

@ -54,7 +54,7 @@ a07b() sync { yield 0; } // //# a07b: compile-time error
a08a() sync* { yield* []; } // //# a08a: ok
a08b() sync { yield 0; } // //# a08b: compile-time error
a09a() async* { yield 0; } // //# a09a: ok
a10a() async* { yield* []; } // //# a10a: static type warning
a10a() async* { yield* []; } // //# a10a: compile-time error
get sync sync {} // //# a11a: compile-time error
get sync sync* {} // //# a11b: ok
@ -122,7 +122,7 @@ class C extends B {
b07a() sync* { yield 0; } // //# b07a: ok
b08a() sync* { yield* []; } // //# b08a: ok
b09a() async* { yield 0; } // //# b09a: ok
b10a() async* { yield* []; } // //# b10a: static type warning
b10a() async* { yield* []; } // //# b10a: compile-time error
b10b() async { yield 0; } // //# b10b: compile-time error
get sync sync {} // //# b11a: compile-time error
@ -167,7 +167,7 @@ method1() {
c07a() sync* { yield 0; } c07a(); // //# c07a: ok
c08a() sync* { yield* []; } c08a(); // //# c08a: ok
c09a() async* { yield 0; } c09a(); // //# c09a: ok
c10a() async* { yield* []; } c10a(); // //# c10a: static type warning
c10a() async* { yield* []; } c10a(); // //# c10a: compile-time error
c11a() async { yield -5; } c11a(); // //# c11a: compile-time error
c11b() async { yield* st; } c11b(); // //# c11b: compile-time error
}
@ -184,10 +184,10 @@ method2() {
var d06a = () async { await for (var o in st) {} }; d06a(); // //# d06a: ok
var d07a = () sync* { yield 0; }; d07a(); // //# d07a: ok
var d08a = () sync* { yield* []; }; d08a(); // //# d08a: ok
var d08b = () sync* { yield*0+1; }; d08b(); // //# d08b: static type warning
var d08b = () sync* { yield*0+1; }; d08b(); // //# d08b: compile-time error
var d08c = () { yield*0+1; }; d08c(); // //# d08c: ok
var d09a = () async* { yield 0; }; d09a(); // //# d09a: ok
var d10a = () async* { yield* []; }; d10a(); // //# d10a: static type warning
var d10a = () async* { yield* []; }; d10a(); // //# d10a: compile-time error
}
void main() {

View file

@ -10,6 +10,22 @@ abstract_exact_selector_test/01: MissingCompileTimeError
abstract_factory_constructor_test/00: MissingCompileTimeError
abstract_getter_test/01: MissingCompileTimeError
abstract_syntax_test/00: MissingCompileTimeError
assign_top_method_test: MissingCompileTimeError
assign_static_type_test/01: MissingCompileTimeError
assign_static_type_test/02: MissingCompileTimeError
assign_static_type_test/03: MissingCompileTimeError
assign_static_type_test/04: MissingCompileTimeError
assign_static_type_test/05: MissingCompileTimeError
assign_static_type_test/06: MissingCompileTimeError
assign_to_type_test/01: MissingCompileTimeError
assign_to_type_test/02: MissingCompileTimeError
assign_to_type_test/03: MissingCompileTimeError
assign_to_type_test/04: MissingCompileTimeError
async_await_syntax_test/a10a: MissingCompileTimeError
async_await_syntax_test/b10a: MissingCompileTimeError
async_await_syntax_test/c10a: MissingCompileTimeError
async_await_syntax_test/d08b: MissingCompileTimeError
async_await_syntax_test/d10a: MissingCompileTimeError
async_or_generator_return_type_stacktrace_test/01: MissingCompileTimeError
async_or_generator_return_type_stacktrace_test/02: MissingCompileTimeError
async_or_generator_return_type_stacktrace_test/03: MissingCompileTimeError
@ -18,12 +34,25 @@ async_return_types_test/tooManyTypeParameters: MissingCompileTimeError
async_return_types_test/wrongReturnType: MissingCompileTimeError
async_return_types_test/nestedFuture: MissingCompileTimeError
[ $compiler == dartdevc ]
[ $compiler == dartdevc || $compiler == dart2analyzer ]
async_return_types_test/nestedFuture: MissingCompileTimeError
[ $compiler == dart2js && ! $dart2js_with_kernel ]
accessor_conflict_export2_test: Crash # Issue 25626
accessor_conflict_export_test: Crash # Issue 25626
assertion_initializer_const_error2_test/cc01: Crash
assertion_initializer_const_error2_test/cc02: Crash
assertion_initializer_const_error2_test/cc03: Crash
assertion_initializer_const_error2_test/cc04: Crash
assertion_initializer_const_error2_test/cc05: Crash
assertion_initializer_const_error2_test/cc06: Crash
assertion_initializer_const_error2_test/cc07: Crash
assertion_initializer_const_error2_test/cc08: Crash
assertion_initializer_const_error2_test/cc09: Crash
assertion_initializer_const_function_error_test/01: Crash
assertion_initializer_const_function_test/01: CompileTimeError
assertion_initializer_test: Crash
assert_trailing_comma_test/none: CompileTimeError # Issue 29959
[ $compiler == dart2js && $runtime != none && ! $dart2js_with_kernel ]
accessor_conflict_import2_test: RuntimeError # Issue 25626
@ -97,6 +126,208 @@ async_star_pause_test: RuntimeError
[ $compiler == dart2js && $dart2js_with_kernel && $use_sdk ]
*: Skip # Issue 29626
[ $compiler == dart2js && ! $checked && ! $enable_asserts && ! $dart2js_with_kernel && $runtime != none ]
assertion_test: RuntimeError # Issue 12748
[ $compiler == dart2js && $dart2js_with_kernel_in_ssa ]
abstract_beats_arguments_test: RuntimeError # Issue 27394
abstract_runtime_error_test/01: RuntimeError # Issue 27394
abstract_runtime_error_test/02: RuntimeError # Issue 27394
arithmetic_canonicalization_test: RuntimeError # Issue 27394
assertion_initializer_const_error_test/01: Crash
assertion_initializer_const_function_test/01: Crash
assign_top_method_test/01: Crash # Issue 27394
async_await_syntax_test/a04b: Crash # Issue 27394
async_await_syntax_test/a06a: RuntimeError # Issue 27394
async_await_syntax_test/a07b: Crash # Issue 27394
async_await_syntax_test/a08b: Crash # Issue 27394
async_await_syntax_test/b06a: RuntimeError # Issue 27394
async_await_syntax_test/c06a: RuntimeError # Issue 27394
async_await_syntax_test/d06a: RuntimeError # Issue 27394
[ $compiler == dart2js && $runtime == d8 && $checked && $dart2js_with_kernel_in_ssa && ! $dart2js_with_kernel ]
assertion_initializer_const_function_test/none: RuntimeError
[ $compiler == dart2js && $runtime == d8 && $dart2js_with_kernel && $host_checked ]
assertion_initializer_const_function_test/01: Crash
assign_instance_method_negative_test: Crash
async_await_syntax_test/d04a: Crash
async_await_syntax_test/d07a: Crash
async_await_syntax_test/d08a: Crash
async_await_syntax_test/d08b: Crash
async_await_syntax_test/d08c: Crash
[ $compiler == dart2js && $runtime == d8 && $dart2js_with_kernel && $minified ]
assert_assignable_type_test: Crash
assert_with_type_test_or_cast_test: Crash
assertion_initializer_const_error_test/none: Crash
assertion_initializer_const_function_error_test/none: Crash
assertion_initializer_const_function_test/01: Crash
assertion_initializer_const_function_test/none: Crash
assign_instance_method_negative_test: Crash
assign_op_test: Crash
assign_static_type_test/03: Crash
assign_static_type_test/04: Crash
assignable_expression_test/none: Crash
async_await_syntax_test/a04a: Crash
async_await_syntax_test/a04c: Crash
async_await_syntax_test/a07a: Crash
async_await_syntax_test/a08a: Crash
async_await_syntax_test/a11b: Crash
async_await_syntax_test/b04a: Crash
async_await_syntax_test/b07a: Crash
async_await_syntax_test/b08a: Crash
async_await_syntax_test/b11b: Crash
async_await_syntax_test/b13a: Crash
async_await_syntax_test/b13c: Crash
async_await_syntax_test/b14a: Crash
async_await_syntax_test/b14c: Crash
async_await_syntax_test/d04a: Crash
async_await_syntax_test/d07a: Crash
async_await_syntax_test/d08a: Crash
async_await_syntax_test/d08b: Crash
async_await_syntax_test/d08c: Crash
[ ($runtime != vm && $compiler != dartk && $compiler != dartkp ) || ($compiler != none && $compiler != dartk && $compiler != dartkp )]
assert_initializer_test/*: Skip # Not implemented yet, experiment is VM only.
[ $compiler == dart2analyzer && $runtime == none ]
assertion_initializer_const_error2_test/none: CompileTimeError
assertion_initializer_const_function_test/01: CompileTimeError
assertion_initializer_test: CompileTimeError
# dartdevc doesn't support assertions in initializers.
[ $compiler == dartdevc ]
assertion_initializer_test: CompileTimeError
assertion_initializer_const_error2_test/none: CompileTimeError
assertion_initializer_const_function_test/01: CompileTimeError
[ $compiler == dartdevc && $runtime != none ]
assert_message_test: RuntimeError # Looks like bug in dartdevc codegen.
[ $compiler == dartk && $runtime == vm ]
arithmetic2_test: RuntimeError # Throws CastError instead of TypeError
assertion_test: RuntimeError
[ $mode == product ]
assertion_test: SkipByDesign # Requires checked mode.
[$compiler == precompiler && $runtime == dart_precompiled && !$checked]
assertion_initializer_const_error2_test/cc01: Pass, OK
assertion_initializer_const_error2_test/cc02: CompileTimeError
assertion_initializer_const_error2_test/cc03: Pass, OK
assertion_initializer_const_error2_test/cc04: Pass, OK
assertion_initializer_const_error2_test/cc05: Pass, OK
assertion_initializer_const_error2_test/cc06: Pass, OK
assertion_initializer_const_error2_test/cc07: Pass, OK
assertion_initializer_const_error2_test/cc08: Pass, OK
assertion_initializer_const_error2_test/cc09: Pass, OK
assertion_initializer_const_error2_test/cc10: Pass, OK
assertion_initializer_const_error2_test/cc11: Pass, OK
assertion_initializer_const_error2_test/none: CompileTimeError
[$compiler == precompiler && $runtime == dart_precompiled && $checked]
assertion_initializer_const_error2_test/cc01: Pass
assertion_initializer_const_error2_test/cc03: Pass
assertion_initializer_const_error2_test/cc04: Pass
assertion_initializer_const_error2_test/cc05: Pass
assertion_initializer_const_error2_test/cc06: Pass
assertion_initializer_const_error2_test/cc07: Pass
assertion_initializer_const_error2_test/cc08: Pass
assertion_initializer_const_error2_test/cc09: Pass
assertion_initializer_const_error2_test/cc10: Pass
assertion_initializer_const_error2_test/cc11: Pass
assertion_initializer_const_error2_test/none: CompileTimeError
[$compiler == none && $runtime == vm && !$checked]
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
assertion_initializer_const_error_test/01: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
[$compiler == none && $runtime == drt && !$checked]
assertion_initializer_const_error2_test/cc02: Fail
assertion_initializer_const_error_test/01: Fail
assertion_initializer_const_function_error_test/01: Fail
[$compiler == app_jit && $runtime == vm && !$checked]
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
assertion_initializer_const_error_test/01: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
[ $compiler == precompiler && $runtime == dart_precompiled ]
assertion_initializer_const_error2_test/cc01: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc02: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc03: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc04: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc05: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc06: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc07: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc08: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc09: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc10: Crash, MissingCompileTimeError
assertion_initializer_const_error2_test/cc11: Crash, MissingCompileTimeError
[ $compiler == precompiler && $runtime == dart_precompiled && !$checked]
assertion_initializer_const_error_test/01: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
[$compiler == dartk && $runtime == vm]
assertion_initializer_const_error2_test/none: CompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
assertion_initializer_test: CompileTimeError
[$compiler == dartk && $runtime == vm && !$checked]
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
[$compiler == dartk && $runtime == vm && $checked]
assertion_initializer_const_function_test/01: RuntimeError
[$compiler == dartkp && $runtime == dart_precompiled]
assertion_initializer_const_error2_test/none: CompileTimeError
[$compiler == dartkp && $runtime == dart_precompiled && !$checked]
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
assertion_initializer_test: CompileTimeError
[$compiler == dartkp && $runtime == dart_precompiled && $checked]
assertion_initializer_const_error2_test/cc02: Crash
assertion_initializer_const_error_test/none: Crash
assertion_initializer_const_function_error_test/01: Crash
assertion_initializer_const_function_error_test/none: Crash
assertion_initializer_const_function_test/01: Crash
assertion_initializer_const_function_test/none: Crash
assertion_initializer_test: CompileTimeError
[ $compiler == dartk || $compiler == dartkp ]
assert_trailing_comma_test/none: CompileTimeError # Issue 29959
# dartk: checked mode failures
[ $checked && ($compiler == dartk || $compiler == dartkp) ]
assert_initializer_test/31: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/32: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/33: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/34: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/35: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/36: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/37: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/38: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/41: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/42: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/43: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/44: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/45: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/46: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/47: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/48: MissingCompileTimeError # KernelVM bug: Constant evaluation.
assert_initializer_test/none: RuntimeError # KernelVM bug: Constant evaluation.
assign_static_type_test/02: MissingCompileTimeError
[($runtime == vm || $runtime == flutter) && $compiler == none && $checked]
# The VM doesn't enforce that potentially const expressions are actually
# const expressions when the constructor is called with `const`.
assert_initializer_test/4*: MissingCompileTimeError # Issue 392.
[ $compiler == dart2js && ! $dart2js_with_kernel && $runtime != none ]
async_star_cancel_while_paused_test: RuntimeError # Issue 22853
@ -165,11 +396,91 @@ async_star_take_reyield_test: Timeout
[ $compiler == none || $compiler == precompiler || $compiler == app_jit ]
async_star_regression_2238_test: CompileTimeError, RuntimeError
[ $runtime == flutter ]
# flutter uses --error_on_bad_type, --error_on_bad_override
# and --await_is_keyword so # the following tests fail with
# a Compilation Error
[ $runtime == flutter ]
async_await_test: CompileTimeError
async_await_syntax_test/a05c: CompileTimeError
async_await_syntax_test/a05e: CompileTimeError
async_await_syntax_test/d08c: CompileTimeError
[ $compiler == dart2js && $runtime == d8 && $dart2js_with_kernel ]
abstract_method_test: Crash
abstract_object_method_test: Crash
abstract_runtime_error_test/01: Crash
abstract_runtime_error_test/02: Crash
arg_param_trailing_comma_test/none: Crash
arithmetic_test: Crash
assert_message_test: Crash
assert_trailing_comma_test/none: CompileTimeError
assertion_initializer_const_error2_test/cc02: Crash
assertion_initializer_const_error2_test/none: CompileTimeError
assertion_initializer_const_function_error_test/01: Crash
assertion_initializer_test: CompileTimeError
assertion_test: Crash
assign_to_type_test/01: Crash
assign_to_type_test/02: Crash
assign_to_type_test/03: Crash
assign_to_type_test/04: Crash
assign_top_method_test/01: Crash
async_and_or_test: Crash
async_await_catch_regression_test: Crash
async_await_syntax_test/a01a: Crash
async_await_syntax_test/a02a: Crash
async_await_syntax_test/a03a: Crash
async_await_syntax_test/a03b: Crash
async_await_syntax_test/a04a: RuntimeError
async_await_syntax_test/a04c: RuntimeError
async_await_syntax_test/a05a: Crash
async_await_syntax_test/a05b: Crash
async_await_syntax_test/a05c: Crash
async_await_syntax_test/a05e: Crash
async_await_syntax_test/a06a: Crash
async_await_syntax_test/a07a: RuntimeError
async_await_syntax_test/a08a: RuntimeError
async_await_syntax_test/a09a: Crash
async_await_syntax_test/a10a: Crash
async_await_syntax_test/a11b: RuntimeError
async_await_syntax_test/a11c: Crash
async_await_syntax_test/a11d: Crash
async_await_syntax_test/a12g: Crash
async_await_syntax_test/b01a: Crash
async_await_syntax_test/b02a: Crash
async_await_syntax_test/b03a: Crash
async_await_syntax_test/b04a: RuntimeError
async_await_syntax_test/b05a: Crash
async_await_syntax_test/b06a: Crash
async_await_syntax_test/b07a: RuntimeError
async_await_syntax_test/b08a: RuntimeError
async_await_syntax_test/b09a: Crash
async_await_syntax_test/b10a: Crash
async_await_syntax_test/b11b: RuntimeError
async_await_syntax_test/b11c: Crash
async_await_syntax_test/b11d: Crash
async_await_syntax_test/b12g: Crash
async_await_syntax_test/c01a: Crash
async_await_syntax_test/c02a: Crash
async_await_syntax_test/c03a: Crash
async_await_syntax_test/c04a: Crash
async_await_syntax_test/c05a: Crash
async_await_syntax_test/c06a: Crash
async_await_syntax_test/c07a: Crash
async_await_syntax_test/c08a: Crash
async_await_syntax_test/c09a: Crash
async_await_syntax_test/c10a: Crash
async_await_syntax_test/d01a: Crash
async_await_syntax_test/d02a: Crash
async_await_syntax_test/d03a: Crash
async_await_syntax_test/d04a: RuntimeError
async_await_syntax_test/d05a: Crash
async_await_syntax_test/d06a: Crash
async_await_syntax_test/d07a: RuntimeError
async_await_syntax_test/d08a: RuntimeError
async_await_syntax_test/d08b: RuntimeError
async_await_syntax_test/d08c: RuntimeError
async_await_syntax_test/d09a: Crash
async_await_syntax_test/d10a: Crash
async_return_types_test/tooManyTypeParameters: CompileTimeError
# Look like bugs.

View file

@ -1,73 +0,0 @@
// Copyright (c) 2012, 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.
// Dart test program to test arithmetic operations.
import "package:expect/expect.dart";
class A {
static foo() => 499;
}
bool throwsNoSuchMethod(f) {
try {
f();
return false;
} on NoSuchMethodError catch (e) {
return true;
}
return false;
}
bool throwsBecauseOfBadArgument(f) {
try {
f();
return false;
} on NoSuchMethodError catch (e) {
return true;
} on ArgumentError catch (e) {
return true;
} on TypeError catch (e) {
// In type checked mode.
return true;
}
return false;
}
numberOpBadSecondArgument(f) {
Expect.isTrue(throwsBecauseOfBadArgument(() => f(true)));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(new A())));
Expect.isTrue(throwsBecauseOfBadArgument(() => f("foo")));
Expect.isTrue(throwsBecauseOfBadArgument(() => f("5")));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(() => 499)));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(null)));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(false)));
Expect.isTrue(throwsBecauseOfBadArgument(() => f([])));
Expect.isTrue(throwsBecauseOfBadArgument(() => f({})));
Expect.isTrue(throwsBecauseOfBadArgument(() => f(A.foo)));
}
badOperations(b) {
Expect.isTrue(throwsNoSuchMethod(() => b - 3));
Expect.isTrue(throwsNoSuchMethod(() => b * 3));
Expect.isTrue(throwsNoSuchMethod(() => b ~/ 3));
Expect.isTrue(throwsNoSuchMethod(() => b / 3));
Expect.isTrue(throwsNoSuchMethod(() => b % 3));
Expect.isTrue(throwsNoSuchMethod(() => b + 3));
Expect.isTrue(throwsNoSuchMethod(() => b[3]));
Expect.isTrue(throwsNoSuchMethod(() => ~b));
Expect.isTrue(throwsNoSuchMethod(() => -b));
}
main() {
numberOpBadSecondArgument((x) => 3 + x);
numberOpBadSecondArgument((x) => 3 - x);
numberOpBadSecondArgument((x) => 3 * x);
numberOpBadSecondArgument((x) => 3 / x);
numberOpBadSecondArgument((x) => 3 ~/ x);
numberOpBadSecondArgument((x) => 3 % x);
badOperations(true);
badOperations(false);
badOperations(() => 499);
badOperations(A.foo);
}

View file

@ -1,28 +0,0 @@
// Copyright (c) 2013, 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.
// Dart test program to test arithmetic operations.
// VMOptions=--optimization-counter-threshold=10 --checked
// This test crashes if we recompute type of AssertAssignableInstr based on its
// output types. By doing that we would eliminate not only the unnecessary
// AssertAssignableInstr but also the trailing class check.
main() {
// Foul up IC data in integer's unary minus.
var y = -0x80000000;
testInt64List();
}
testInt64List() {
var array = new List(10);
testInt64ListImpl(array);
}
testInt64ListImpl(array) {
for (int i = 0; i < 10; ++i) {}
int sum = 0;
for (int i = 0; i < 10; ++i) {
array[i] = -0x80000000000000 + i;
}
}

View file

@ -1,28 +0,0 @@
// Copyright (c) 2012, 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.
// Issue 3741: generic type tests and casts fail in assertion statements
// when run in production mode.
//
// The cause was incomplete generic type skipping, so each of the assert
// statements below would fail.
//
// VMOptions=
// VMOptions=--enable_asserts
main() {
var names = new List<int>();
// Generic type test.
assert(names is List<int>);
// Negated generic type test.
assert(names is! List<String>);
// Generic type cast.
assert((names as List<num>).length == 0);
// Generic type test inside expression.
assert((names is List<int>));
}

View file

@ -1,96 +0,0 @@
// Copyright (c) 2011, 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.
// Dart test program for testing assign operators.
// VMOptions=--optimization-counter-threshold=10
import "package:expect/expect.dart";
class AssignOpTest {
AssignOpTest() {}
static testMain() {
var b = 0;
b += 1;
Expect.equals(1, b);
b *= 5;
Expect.equals(5, b);
b -= 1;
Expect.equals(4, b);
b ~/= 2;
Expect.equals(2, b);
f = 0;
f += 1;
Expect.equals(1, f);
f *= 5;
Expect.equals(5, f);
f -= 1;
Expect.equals(4, f);
f ~/= 2;
Expect.equals(2, f);
f /= 4;
Expect.equals(.5, f);
AssignOpTest.f = 0;
AssignOpTest.f += 1;
Expect.equals(1, AssignOpTest.f);
AssignOpTest.f *= 5;
Expect.equals(5, AssignOpTest.f);
AssignOpTest.f -= 1;
Expect.equals(4, AssignOpTest.f);
AssignOpTest.f ~/= 2;
Expect.equals(2, AssignOpTest.f);
AssignOpTest.f /= 4;
Expect.equals(.5, f);
var o = new AssignOpTest();
o.instf = 0;
o.instf += 1;
Expect.equals(1, o.instf);
o.instf *= 5;
Expect.equals(5, o.instf);
o.instf -= 1;
Expect.equals(4, o.instf);
o.instf ~/= 2;
Expect.equals(2, o.instf);
o.instf /= 4;
Expect.equals(.5, o.instf);
var x = 0xFF;
x >>= 3;
Expect.equals(0x1F, x);
x <<= 3;
Expect.equals(0xF8, x);
x |= 0xF00;
Expect.equals(0xFF8, x);
x &= 0xF0;
Expect.equals(0xF0, x);
x ^= 0x11;
Expect.equals(0xE1, x);
var y = 100;
y += 1 << 3;
Expect.equals(108, y);
y *= 2 + 1;
Expect.equals(324, y);
y -= 3 - 2;
Expect.equals(323, y);
y += 3 * 4;
Expect.equals(335, y);
var a = [1, 2, 3];
var ix = 0;
a[ix] |= 12;
Expect.equals(13, a[ix]);
}
static var f;
var instf;
}
main() {
for (int i = 0; i < 20; i++) {
AssignOpTest.testMain();
}
}

View file

@ -1,33 +0,0 @@
// Copyright (c) 2012, 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.
// This test insures that statically initialized variables, fields, and parameters
// report static type warnings.
int a = "String"; // //# 01: static type warning, dynamic type error
class A {
static const int c = "String"; //# 02: static type warning, checked mode compile-time error
final int d = "String"; //# 03: static type warning, dynamic type error
int e = "String"; //# 04: static type warning, dynamic type error
A() {
int f = "String"; //# 05: static type warning, dynamic type error
}
method(
[
int // //# 06: static type warning
g = "String"]) {
return g;
}
}
int main() {
var w = a; //# 01: continued
var x;
x = A.c; // //# 02: continued
var v = new A();
x = v.d; // //# 03: continued
x = v.e; // //# 04: continued
x = v.method(1); //# 06: continued
}

View file

@ -1,29 +0,0 @@
// Copyright (c) 2015, 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.
// Verify that an attempt to assign to a class, enum, typedef, or type
// parameter produces a static warning and runtime error.
import "package:expect/expect.dart";
noMethod(e) => e is NoSuchMethodError;
class C<T> {
f() {
Expect.throws(() => T = null, noMethod); //# 01: static type warning
}
}
class D {}
enum E { e0 }
typedef void F();
main() {
new C<D>().f();
Expect.throws(() => D = null, noMethod); //# 02: static type warning
Expect.throws(() => E = null, noMethod); //# 03: static type warning
Expect.throws(() => F = null, noMethod); //# 04: static type warning
}

View file

@ -1,44 +0,0 @@
// Copyright (c) 2013, 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.
// Test to detect syntactically illegal left-hand-side (assignable)
// expressions.
class C {
static var static_field = 0;
}
var tl_static_var = 0;
main() {
tl_static_var = 0;
(tl_static_var) = 0; // //# 01: compile-time error
(tl_static_var)++; // //# 02: compile-time error
++(tl_static_var); // //# 03: compile-time error
C.static_field = 0;
(C.static_field) = 0; // //# 11: compile-time error
(C.static_field)++; // //# 12: compile-time error
++(C.static_field); // //# 13: compile-time error
tl_static_var = [1, 2, 3];
tl_static_var[0] = 0;
(tl_static_var)[0] = 0;
(tl_static_var[0]) = 0; // //# 21: compile-time error
(tl_static_var[0])++; // //# 22: compile-time error
++(tl_static_var[0]); // //# 23: compile-time error
C.static_field = [1, 2, 3];
(C.static_field[0]) = 0; // //# 31: compile-time error
(C.static_field[0])++; // //# 32: compile-time error
++(C.static_field[0]); // //# 33: compile-time error
var a = 0;
(a) = 0; // //# 41: compile-time error
(a)++; // //# 42: compile-time error
++(a); // //# 43: compile-time error
// Neat palindrome expression. x is assignable, ((x)) is not.
var funcnuf = (x) => ((x))=((x)) <= (x); // //# 50: compile-time error
}

View file

@ -1,88 +0,0 @@
// Copyright (c) 2015, 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";
import "package:async_helper/async_helper.dart";
@NoInline()
@AssumeDynamic()
confuse(x) {
return x;
}
test1() async {
Expect.isFalse(await confuse(false) && await confuse(false));
Expect.isFalse(await confuse(false) && await confuse(true));
Expect.isFalse(await confuse(true) && await confuse(false));
Expect.isTrue(await confuse(true) && await confuse(true));
Expect.isFalse(await confuse(false) || await confuse(false));
Expect.isTrue(await confuse(false) || await confuse(true));
Expect.isTrue(await confuse(true) || await confuse(false));
Expect.isTrue(await confuse(true) || await confuse(true));
}
String trace;
traceA(x) {
trace += "a";
return x;
}
traceB(x) {
trace += "b";
return x;
}
testEvaluation(void fn()) async {
trace = "";
await fn();
}
test2() async {
await testEvaluation(() async {
Expect
.isFalse(await confuse(traceA(false)) && await confuse(traceB(false)));
Expect.equals("a", trace);
});
await testEvaluation(() async {
Expect.isFalse(await confuse(traceA(false)) && await confuse(traceB(true)));
Expect.equals("a", trace);
});
await testEvaluation(() async {
Expect.isFalse(await confuse(traceA(true)) && await confuse(traceB(false)));
Expect.equals("ab", trace);
});
await testEvaluation(() async {
Expect.isTrue(await confuse(traceA(true)) && await confuse(traceB(true)));
Expect.equals("ab", trace);
});
await testEvaluation(() async {
Expect
.isFalse(await confuse(traceA(false)) || await confuse(traceB(false)));
Expect.equals("ab", trace);
});
await testEvaluation(() async {
Expect.isTrue(await confuse(traceA(false)) || await confuse(traceB(true)));
Expect.equals("ab", trace);
});
await testEvaluation(() async {
Expect.isTrue(await confuse(traceA(true)) || await confuse(traceB(false)));
Expect.equals("a", trace);
});
await testEvaluation(() async {
Expect.isTrue(await confuse(traceA(true)) || await confuse(traceB(true)));
Expect.equals("a", trace);
});
}
test() async {
await test1();
await test2();
}
main() {
asyncStart();
test().then((_) => asyncEnd());
}

View file

@ -1,26 +0,0 @@
// Copyright (c) 2015, 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";
import "package:async_helper/async_helper.dart";
foo() async {
throw 42;
}
test() async {
var exception;
try {
await foo();
} catch (e) {
print(await (e));
await (exception = await e);
}
Expect.equals(42, exception);
}
main() {
asyncStart();
test().then((_) => asyncEnd());
}

View file

@ -1,301 +0,0 @@
// Copyright (c) 2015, 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.
// Test async/await syntax.
import 'dart:async' show Stream;
var yield = 0;
var await = 0;
get st => new Stream.fromIterable([]);
a01a() async => null; // //# a01a: ok
a01b() async* => null; // //# a01b: compile-time error
a01c() sync* => null; // //# a01c: compile-time error
a01d() async => yield 5; // //# a01d: compile-time error
a02a() async {} // //# a02a: ok
a03a() async* {} // //# a03a: ok
a03b() async * {} // //# a03b: ok
a04a() sync* {} // //# a04a: ok
a04b() sync {} // //# a04b: compile-time error
a04c() sync * {} // //# a04c: ok
a05a() async { await 0; } // //# a05a: ok
a05b() async { // //# a05b: ok
await(a) {}; // //# a05b: continued
await(0); // //# a05b: continued
} // //# a05b: continued
a05c() { // //# a05c: ok
await(a) {}; // //# a05c: continued
await(0); // //# a05c: continued
} // //# a05c: continued
a05d() async { // //# a05d: compile-time error
await(a) {} // //# a05d: continued
await(0); // //# a05d: continued
} // //# a05d: continued
a05e() { // //# a05e: ok
await(a) {} // //# a05e: continued
await(0); // //# a05e: continued
} // //# a05e: continued
a05f() async { // //# a05f: compile-time error
var await = (a) {}; // //# a05f: continued
await(0); // //# a05f: continued
} // //# a05f: continued
a05g() async { // //# a05g: continued
yield 5; // //# a05g: compile-time error
} // //# a05g: continued
a05h() async { // //# a05h: continued
yield* st; // //# a05h: compile-time error
} // //# a05h: continued
a06a() async { await for (var o in st) {} } // //# a06a: ok
a06b() sync* { await for (var o in st) {} } // //# a06b: compile-time error
a07a() sync* { yield 0; } // //# a07a: ok
a07b() sync { yield 0; } // //# a07b: compile-time error
a08a() sync* { yield* []; } // //# a08a: ok
a08b() sync { yield 0; } // //# a08b: compile-time error
a09a() async* { yield 0; } // //# a09a: ok
a10a() async* { yield* []; } // //# a10a: static type warning
get sync sync {} // //# a11a: compile-time error
get sync sync* {} // //# a11b: ok
get async async {} // //# a11c: ok
get async async* {} // //# a11d: ok
get sync {} // //# a12a: ok
get sync* {} // //# a12b: compile-time error
get async {} // //# a12c: ok
get async* {} // //# a12d: compile-time error
get a12e sync* => null; // //# a12e: compile-time error
get a12f async* => null; // //# a12f: compile-time error
get a12g async => null; // //# a12g: ok
int sync; // //# a13a: ok
int sync*; // //# a13b: compile-time error
int async; // //# a13c: ok
int async*; // //# a13d: compile-time error
var sync; // //# a14a: ok
var sync*; // //# a14b: compile-time error
var async; // //# a14c: ok
var async*; // //# a14d: compile-time error
sync() {} // //# a15a: ok
sync*() {} // //# a15b: compile-time error
async() {} // //# a15c: ok
async*() {} // //# a15d: compile-time error
abstract class B {
b00a() async; // //# b00a: compile-time error
b00b() async*; // //# b00b: compile-time error
b00c() sync*; // //# b00c: compile-time error
b00d() sync; // //# b00d: compile-time error
}
class C extends B {
C();
factory C.e1() async { return null; } // //# e1: compile-time error
factory C.e2() async* { return null; } // //# e2: compile-time error
factory C.e3() sync* { return null; } // //# e3: compile-time error
factory C.e4() async = C; // //# e4: compile-time error
factory C.e5() async* = C; // //# e5: compile-time error
factory C.e6() sync* = C; // //# e6: compile-time error
C.e7() async {} // //# e7: compile-time error
C.e8() async* {} // //# e8: compile-time error
C.e9() sync* {} // //# e9: compile-time error
b00a() {} // //# b00a: continued
b00b() {} // //# b00b: continued
b00c() {} // //# b00c: continued
b00d() {} // //# b00d: continued
b01a() async => null; // //# b01a: ok
b01b() async* => null; // //# b01b: compile-time error
b01c() sync* => null; // //# b01c: compile-time error
b02a() async {} // //# b02a: ok
b03a() async* {} // //# b03a: ok
b04a() sync* {} // //# b04a: ok
b04b() sync {} // //# b04b: compile-time error
b05a() async { await 0; } // //# b05a: ok
b06a() async { await for (var o in st) {} } // //# b06a: ok
b06b() async { await for ( ; ; ) {} } // //# b06b: compile-time error
b07a() sync* { yield 0; } // //# b07a: ok
b08a() sync* { yield* []; } // //# b08a: ok
b09a() async* { yield 0; } // //# b09a: ok
b10a() async* { yield* []; } // //# b10a: static type warning
b10b() async { yield 0; } // //# b10b: compile-time error
get sync sync {} // //# b11a: compile-time error
get sync sync* {} // //# b11b: ok
get async async {} // //# b11c: ok
get async async* {} // //# b11d: ok
get sync {} // //# b12a: ok
get sync* {} // //# b12b: compile-time error
get async {} // //# b12c: ok
get async* {} // //# b12d: compile-time error
get b12e sync* => null; // //# b12e: compile-time error
get b12f async* => null; // //# b12f: compile-time error
get b12g async => null; // //# b12g: ok
int sync; // //# b13a: ok
int sync*; // //# b13b: compile-time error
int async; // //# b13c: ok
int async*; // //# b13d: compile-time error
var sync; // //# b14a: ok
var sync*; // //# b14b: compile-time error
var async; // //# b14c: ok
var async*; // //# b14d: compile-time error
sync() {} // //# b15a: ok
sync*() {} // //# b15b: compile-time error
async() {} // //# b15c: ok
async*() {} // //# b15d: compile-time error
}
method1() {
c01a() async => null; c01a(); // //# c01a: ok
c01b() async* => null; c01b(); // //# c01b: compile-time error
c01c() sync* => null; c01c(); // //# c01c: compile-time error
c02a() async {} c02a(); // //# c02a: ok
c03a() async* {} c03a(); // //# c03a: ok
c04a() sync* {} c04a(); // //# c04a: ok
c04b() sync {} c04b(); // //# c04b: compile-time error
c05a() async { await 0; } c05a(); // //# c05a: ok
c06a() async { await for (var o in st) {} } c06a(); // //# c06a: ok
c07a() sync* { yield 0; } c07a(); // //# c07a: ok
c08a() sync* { yield* []; } c08a(); // //# c08a: ok
c09a() async* { yield 0; } c09a(); // //# c09a: ok
c10a() async* { yield* []; } c10a(); // //# c10a: static type warning
c11a() async { yield -5; } c11a(); // //# c11a: compile-time error
c11b() async { yield* st; } c11b(); // //# c11b: compile-time error
}
method2() {
var d01a = () async => null; d01a(); // //# d01a: ok
var d01b = () async* => null; d01b(); // //# d01b: compile-time error
var d01c = () sync* => null; d01c(); // //# d01c: compile-time error
var d02a = () async {}; d02a(); // //# d02a: ok
var d03a = () async* {}; d03a(); // //# d03a: ok
var d04a = () sync* {}; d04a(); // //# d04a: ok
var d04b = () sync {}; d04b(); // //# d04b: compile-time error
var d05a = () async { await 0; }; d05a(); // //# d05a: ok
var d06a = () async { await for (var o in st) {} }; d06a(); // //# d06a: ok
var d07a = () sync* { yield 0; }; d07a(); // //# d07a: ok
var d08a = () sync* { yield* []; }; d08a(); // //# d08a: ok
var d08b = () sync* { yield*0+1; }; d08b(); // //# d08b: static type warning
var d08c = () { yield*0+1; }; d08c(); // //# d08c: ok
var d09a = () async* { yield 0; }; d09a(); // //# d09a: ok
var d10a = () async* { yield* []; }; d10a(); // //# d10a: static type warning
}
void main() {
var a;
var c = new C();
c = new C.e1(); //# e1: continued
c = new C.e2(); //# e2: continued
c = new C.e3(); //# e3: continued
c = new C.e4(); //# e4: continued
c = new C.e5(); //# e5: continued
c = new C.e6(); //# e6: continued
c = new C.e7(); //# e7: continued
c = new C.e8(); //# e8: continued
c = new C.e9(); //# e9: continued
a01a(); // //# a01a: continued
a01b(); // //# a01b: continued
a01c(); // //# a01c: continued
a01d(); // //# a01d: continued
a02a(); // //# a02a: continued
a03a(); // //# a03a: continued
a03b(); // //# a03b: continued
a04a(); // //# a04a: continued
a04b(); // //# a04b: continued
a04c(); // //# a04c: continued
a05a(); // //# a05a: continued
a05b(); // //# a05b: continued
a05c(); // //# a05c: continued
a05d(); // //# a05d: continued
a05e(); // //# a05e: continued
a05f(); // //# a05f: continued
a05g(); // //# a05g: continued
a05h(); // //# a05h: continued
a06a(); // //# a06a: continued
a06b(); // //# a06b: continued
a07a(); // //# a07a: continued
a07b(); // //# a07b: continued
a08a(); // //# a08a: continued
a08b(); // //# a08b: continued
a09a(); // //# a09a: continued
a10a(); // //# a10a: continued
a = sync; // //# a11a: continued
a = sync; // //# a11b: continued
a = async; // //# a11c: continued
a = async; // //# a11d: continued
a = sync; // //# a12a: continued
a = sync; // //# a12b: continued
a = async; // //# a12c: continued
a = async; // //# a12d: continued
a = a12e; // //# a12e: continued
a = a12f; // //# a12f: continued
a = a12g; // //# a12g: continued
a = sync; // //# a13a: continued
a = sync; // //# a13b: continued
a = async; // //# a13c: continued
a = async; // //# a13d: continued
a = sync; // //# a14a: continued
a = sync; // //# a14b: continued
a = async; // //# a14c: continued
a = async; // //# a14d: continued
sync(); // //# a15a: continued
sync(); // //# a15b: continued
async(); // //# a15c: continued
async(); // //# a15d: continued
c.b00a(); // //# b00a: continued
c.b00b(); // //# b00b: continued
c.b00c(); // //# b00c: continued
c.b00d(); // //# b00d: continued
c.b01a(); // //# b01a: continued
c.b01b(); // //# b01b: continued
c.b01c(); // //# b01c: continued
c.b02a(); // //# b02a: continued
c.b03a(); // //# b03a: continued
c.b04a(); // //# b04a: continued
c.b04b(); // //# b04b: continued
c.b05a(); // //# b05a: continued
c.b06a(); // //# b06a: continued
c.b06b(); // //# b06b: continued
c.b07a(); // //# b07a: continued
c.b08a(); // //# b08a: continued
c.b09a(); // //# b09a: continued
c.b10a(); // //# b10a: continued
c.b10b(); // //# b10b: continued
a = c.sync; // //# b11a: continued
a = c.sync; // //# b11b: continued
a = c.async; // //# b11c: continued
a = c.async; // //# b11d: continued
a = c.sync; // //# b12a: continued
a = c.sync; // //# b12b: continued
a = c.async; // //# b12c: continued
a = c.async; // //# b12d: continued
a = c.b12e; // //# b12e: continued
a = c.b12f; // //# b12f: continued
a = c.b12g; // //# b12g: continued
a = c.sync; // //# b13a: continued
a = c.sync; // //# b13b: continued
a = c.async; // //# b13c: continued
a = c.async; // //# b13d: continued
a = c.sync; // //# b14a: continued
a = c.sync; // //# b14b: continued
a = c.async; // //# b14c: continued
a = c.async; // //# b14d: continued
c.sync(); // //# b15a: continued
c.sync(); // //# b15b: continued
c.async(); // //# b15c: continued
c.async(); // //# b15d: continued
method1();
method2();
}

View file

@ -8,15 +8,6 @@
# Skip tests that are not yet strong-mode clean.
[ $strong ]
abstract_exact_selector_test: Skip
abstract_runtime_error_test: Skip
argument_definition_test: Skip
assign_instance_method_negative_test: Skip
assign_static_type_test: Skip
assign_to_type_test: Skip
assign_top_method_test: Skip
assignable_expression_test: Skip
async_await_syntax_test: Skip
async_or_generator_return_type_stacktrace_test: Skip
async_return_types_test: Skip
await_backwards_compatibility_test: Skip

View file

@ -3,8 +3,6 @@
# BSD-style license that can be found in the LICENSE file.
[ $compiler == dartk && $runtime == vm ]
arithmetic2_test: RuntimeError # Throws CastError instead of TypeError
assertion_test: RuntimeError
async_await_test/02: DartkCompileTimeError
async_await_test/03: DartkCompileTimeError
async_await_test/none: DartkCompileTimeError