Format tests/web/ using the 3.8 formatting style.

Change-Id: I73edeeaf4934899b71d6335dcb4b4b54dce46bae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426340
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
This commit is contained in:
Robert Nystrom
2025-05-02 20:17:11 -07:00
committed by Commit Queue
parent b03f3b7b8d
commit ba40d9bece
118 changed files with 5065 additions and 2173 deletions
+3 -1
View File
@@ -37,7 +37,9 @@ testTypeErrors() {
fault();
} catch (e) {
Expect.isTrue(
e is TypeError, 'name: <<$e>> (${e.runtimeType}) is TypeError');
e is TypeError,
'name: <<$e>> (${e.runtimeType}) is TypeError',
);
return;
}
Expect.fail('Expected assert to throw');
File diff suppressed because one or more lines are too long
@@ -8,15 +8,15 @@
import "package:expect/expect.dart";
final _a = {
...{1}
...{1},
};
class B {
static Set _b = {
...{2}
...{2},
};
Set _c = {
...{3}
...{3},
};
}
+12 -6
View File
@@ -32,31 +32,37 @@ const ddc = const bool.fromEnvironment('dart.library._ddc_only');
dynamic confuse(dynamic x) => x;
class C {
int Function(String s) get call => (s) => s.length;
int Function(String s) get call =>
(s) => s.length;
}
class C2 {
Function get call => (s) => s.length;
Function get call =>
(s) => s.length;
}
extension on A {
int Function(String s) get call => (s) => s.length;
int Function(String s) get call =>
(s) => s.length;
}
class A {}
extension on A2 {
Function get call => (s) => s.length;
Function get call =>
(s) => s.length;
}
class A2 {}
extension type ExtType(B _) {
int Function(String s) get call => (s) => s.length;
int Function(String s) get call =>
(s) => s.length;
}
extension type ExtType2(B _) {
Function get call => (s) => s.length;
Function get call =>
(s) => s.length;
}
class B {}
+16 -12
View File
@@ -47,12 +47,14 @@ closure2() {
closure3() {
var fs = [];
for (var i = 0;
i < 3;
(() {
fs.add(() => i);
i++;
})()) {
for (
var i = 0;
i < 3;
(() {
fs.add(() => i);
i++;
})()
) {
i++;
}
Expect.equals(2, fs.length);
@@ -62,12 +64,14 @@ closure3() {
closure4() {
var g;
for (var i = 0;
(() {
g = () => i;
return false;
})();
i++) {
for (
var i = 0;
(() {
g = () => i;
return false;
})();
i++
) {
Expect.equals(false, true);
}
Expect.equals(0, g());
+1 -1
View File
@@ -16,7 +16,7 @@ main() {
var a = new A<int>();
a.xs = [
[1, 2, 3],
[4, 5, 6]
[4, 5, 6],
];
// just check that this doesn't crash
a.foo();
+18 -9
View File
@@ -28,9 +28,12 @@ applyFun(f) {
closure2() {
var x = 499;
Expect.equals(499, applyFun(() {
return x;
}));
Expect.equals(
499,
applyFun(() {
return x;
}),
);
}
closure3() {
@@ -47,9 +50,12 @@ applyFun2(f) {
closure4() {
var z = 9;
Expect.equals(499, applyFun2((x, y) {
return x + y + z;
}));
Expect.equals(
499,
applyFun2((x, y) {
return x + y + z;
}),
);
}
closure5() {
@@ -92,9 +98,12 @@ closure8() {
closure9() {
var z = 9;
Expect.equals(499, applyFun2((x, y) {
return x + y + z;
}));
Expect.equals(
499,
applyFun2((x, y) {
return x + y + z;
}),
);
}
main() {
+12 -6
View File
@@ -25,9 +25,12 @@ applyFun(f) {
}
closure2() {
Expect.equals(499, applyFun(() {
return 499;
}));
Expect.equals(
499,
applyFun(() {
return 499;
}),
);
}
closure3() {
@@ -42,9 +45,12 @@ applyFun2(f) {
}
closure4() {
Expect.equals(499, applyFun2((x, y) {
return x + y;
}));
Expect.equals(
499,
applyFun2((x, y) {
return x + y;
}),
);
}
main() {
+4 -2
View File
@@ -79,8 +79,10 @@ call2b() {
checkNSME(text) {
return (e) {
Expect.isTrue(e is NoSuchMethodError,
'expecting NoSuchMethodError, got "${e.runtimeType}"');
Expect.isTrue(
e is NoSuchMethodError,
'expecting NoSuchMethodError, got "${e.runtimeType}"',
);
Expect.isTrue('$e'.contains(text), '"$e".contains("$text")');
return e is NoSuchMethodError;
};
+1 -1
View File
@@ -63,4 +63,4 @@ main() {
test(d0, d1, d2, d3, d4);
test(e0, e1, e2, e3, e4);
test(f0, f1, f2, f3, f4);
}
}
+176 -82
View File
@@ -202,8 +202,10 @@ void main() {
const Subtract(-9007199254740992, 1, -9007199254740992).check();
const Subtract(-9007199254740992, 100, -9007199254741092).check();
const Subtract(
0x7fffffff00000000, -0x7fffffff00000000, 2 * 0x7fffffff00000000)
.check();
0x7fffffff00000000,
-0x7fffffff00000000,
2 * 0x7fffffff00000000,
).check();
const Subtract(4.2, 1.5, 2.7).check();
const Subtract(1.5, 4.2, -2.7).check();
const Subtract(1.5, 0, 1.5).check();
@@ -215,8 +217,11 @@ void main() {
const Subtract(-0.0, 0.0, -0.0).check();
const Subtract(-0.0, -0.0, 0.0).check();
const Subtract(double.maxFinite, -double.maxFinite, double.infinity).check();
const Subtract(-double.maxFinite, double.maxFinite, double.negativeInfinity)
.check();
const Subtract(
-double.maxFinite,
double.maxFinite,
double.negativeInfinity,
).check();
const Subtract(1.5, double.nan, double.nan).check();
const Subtract(double.nan, 1.5, double.nan).check();
const Subtract(double.nan, double.nan, double.nan).check();
@@ -227,21 +232,33 @@ void main() {
const Subtract(double.infinity, double.maxFinite, double.infinity).check();
const Subtract(double.infinity, -double.maxFinite, double.infinity).check();
const Subtract(
double.negativeInfinity, double.maxFinite, double.negativeInfinity)
.check();
double.negativeInfinity,
double.maxFinite,
double.negativeInfinity,
).check();
const Subtract(
double.negativeInfinity, -double.maxFinite, double.negativeInfinity)
.check();
double.negativeInfinity,
-double.maxFinite,
double.negativeInfinity,
).check();
const Subtract(1.5, double.infinity, double.negativeInfinity).check();
const Subtract(1.5, double.negativeInfinity, double.infinity).check();
const Subtract(double.infinity, double.infinity, double.nan).check();
const Subtract(double.infinity, double.negativeInfinity, double.infinity)
.check();
const Subtract(
double.negativeInfinity, double.infinity, double.negativeInfinity)
.check();
const Subtract(double.negativeInfinity, double.negativeInfinity, double.nan)
.check();
double.infinity,
double.negativeInfinity,
double.infinity,
).check();
const Subtract(
double.negativeInfinity,
double.infinity,
double.negativeInfinity,
).check();
const Subtract(
double.negativeInfinity,
double.negativeInfinity,
double.nan,
).check();
const Subtract(double.minPositive, double.minPositive, 0.0).check();
const Subtract(-double.minPositive, -double.minPositive, 0.0).check();
@@ -259,8 +276,11 @@ void main() {
const Multiply(18014398509481984, -1, -18014398509481984).check();
const Multiply(-1, 18014398509481984, -18014398509481984).check();
const Multiply(9000000000000000, 9000000000000000, 8.1e31).check();
const Multiply(0x7fff000000000000, 0x8000000000000000, 8.506799558180535e37)
.check();
const Multiply(
0x7fff000000000000,
0x8000000000000000,
8.506799558180535e37,
).check();
const Multiply(0x8000000000000000, 1.2, 11068046444225730000.0).check();
const Multiply(3.14, 2.72, 8.5408).check();
const Multiply(-3.14, 2.72, -8.5408).check();
@@ -273,10 +293,16 @@ void main() {
const Multiply(-0.0, 0.0, -0.0).check();
const Multiply(-0.0, -0.0, 0.0).check();
const Multiply(double.maxFinite, double.maxFinite, double.infinity).check();
const Multiply(double.maxFinite, -double.maxFinite, double.negativeInfinity)
.check();
const Multiply(-double.maxFinite, double.maxFinite, double.negativeInfinity)
.check();
const Multiply(
double.maxFinite,
-double.maxFinite,
double.negativeInfinity,
).check();
const Multiply(
-double.maxFinite,
double.maxFinite,
double.negativeInfinity,
).check();
const Multiply(-double.maxFinite, -double.maxFinite, double.infinity).check();
const Multiply(0, double.nan, double.nan).check();
const Multiply(double.nan, 0, double.nan).check();
@@ -291,14 +317,20 @@ void main() {
const Multiply(double.negativeInfinity, -0.0, double.nan).check();
const Multiply(double.infinity, double.infinity, double.infinity).check();
const Multiply(
double.infinity, double.negativeInfinity, double.negativeInfinity)
.check();
double.infinity,
double.negativeInfinity,
double.negativeInfinity,
).check();
const Multiply(
double.negativeInfinity, double.infinity, double.negativeInfinity)
.check();
double.negativeInfinity,
double.infinity,
double.negativeInfinity,
).check();
const Multiply(
double.negativeInfinity, double.negativeInfinity, double.infinity)
.check();
double.negativeInfinity,
double.negativeInfinity,
double.infinity,
).check();
const Multiply(double.minPositive, 0.5, 0.0).check();
const Multiply(double.minPositive, -0.5, -0.0).check();
const Multiply(-double.minPositive, 0.5, -0.0).check();
@@ -306,10 +338,15 @@ void main() {
const Multiply(1e-300, -1e-300, -0.0).check();
const Multiply(double.minPositive, double.infinity, double.infinity).check();
const Multiply(
double.minPositive, double.negativeInfinity, double.negativeInfinity)
.check();
const Multiply(double.minPositive, double.maxFinite, 8.881784197001251e-16)
.check();
double.minPositive,
double.negativeInfinity,
double.negativeInfinity,
).check();
const Multiply(
double.minPositive,
double.maxFinite,
8.881784197001251e-16,
).check();
const Modulo(27, 314159, 27).check();
const Modulo(27, 1, 0).check();
@@ -358,8 +395,11 @@ void main() {
const Modulo(double.infinity, double.infinity, double.nan).check();
const Modulo(double.negativeInfinity, double.infinity, double.nan).check();
const Modulo(double.infinity, double.negativeInfinity, double.nan).check();
const Modulo(double.negativeInfinity, double.negativeInfinity, double.nan)
.check();
const Modulo(
double.negativeInfinity,
double.negativeInfinity,
double.nan,
).check();
const TruncatingDivide(27, 314159, 0).check();
const TruncatingDivide(27, 1, 27).check();
@@ -424,23 +464,41 @@ void main() {
const Divide(-4294967295, 4294967296, -0.9999999997671694).check();
const Divide(-4294967295, -4294967296, 0.9999999997671694).check();
const Divide(9007199254740991, 9007199254740992, 0.9999999999999999).check();
const Divide(9007199254740991, -9007199254740992, -0.9999999999999999)
.check();
const Divide(-9007199254740991, 9007199254740992, -0.9999999999999999)
.check();
const Divide(-9007199254740991, -9007199254740992, 0.9999999999999999)
.check();
const Divide(
9007199254740991,
-9007199254740992,
-0.9999999999999999,
).check();
const Divide(
-9007199254740991,
9007199254740992,
-0.9999999999999999,
).check();
const Divide(
-9007199254740991,
-9007199254740992,
0.9999999999999999,
).check();
const Divide(4294967296, 4294967295, 1.0000000002328306).check();
const Divide(4294967296, -4294967295, -1.0000000002328306).check();
const Divide(-4294967296, 4294967295, -1.0000000002328306).check();
const Divide(-4294967296, -4294967295, 1.0000000002328306).check();
const Divide(9007199254740992, 9007199254740991, 1.0000000000000002).check();
const Divide(9007199254740992, -9007199254740991, -1.0000000000000002)
.check();
const Divide(-9007199254740992, 9007199254740991, -1.0000000000000002)
.check();
const Divide(-9007199254740992, -9007199254740991, 1.0000000000000002)
.check();
const Divide(
9007199254740992,
-9007199254740991,
-1.0000000000000002,
).check();
const Divide(
-9007199254740992,
9007199254740991,
-1.0000000000000002,
).check();
const Divide(
-9007199254740992,
-9007199254740991,
1.0000000000000002,
).check();
const Divide(4294967295, 0.5, 8589934590).check();
const Divide(4294967295, -0.5, -8589934590).check();
const Divide(-4294967295, 0.5, -8589934590).check();
@@ -497,10 +555,16 @@ void main() {
const Divide(-double.minPositive, double.maxFinite, -0.0).check();
const Divide(-double.minPositive, -double.maxFinite, 0).check();
const Divide(double.maxFinite, double.minPositive, double.infinity).check();
const Divide(double.maxFinite, -double.minPositive, double.negativeInfinity)
.check();
const Divide(-double.maxFinite, double.minPositive, double.negativeInfinity)
.check();
const Divide(
double.maxFinite,
-double.minPositive,
double.negativeInfinity,
).check();
const Divide(
-double.maxFinite,
double.minPositive,
double.negativeInfinity,
).check();
const Divide(-double.maxFinite, -double.minPositive, double.infinity).check();
const Add("", "", "").check();
@@ -543,8 +607,11 @@ void main() {
const Add(-0.0, 0.0, 0.0).check();
const Add(-0.0, -0.0, -0.0).check();
const Add(double.maxFinite, double.maxFinite, double.infinity).check();
const Add(-double.maxFinite, -double.maxFinite, double.negativeInfinity)
.check();
const Add(
-double.maxFinite,
-double.maxFinite,
double.negativeInfinity,
).check();
const Add(1.5, double.nan, double.nan).check();
const Add(double.nan, 1.5, double.nan).check();
const Add(double.nan, double.nan, double.nan).check();
@@ -554,18 +621,26 @@ void main() {
const Add(double.negativeInfinity, double.nan, double.nan).check();
const Add(double.infinity, -double.maxFinite, double.infinity).check();
const Add(double.infinity, double.maxFinite, double.infinity).check();
const Add(double.negativeInfinity, -double.maxFinite, double.negativeInfinity)
.check();
const Add(double.negativeInfinity, double.maxFinite, double.negativeInfinity)
.check();
const Add(
double.negativeInfinity,
-double.maxFinite,
double.negativeInfinity,
).check();
const Add(
double.negativeInfinity,
double.maxFinite,
double.negativeInfinity,
).check();
const Add(1.5, double.negativeInfinity, double.negativeInfinity).check();
const Add(1.5, double.infinity, double.infinity).check();
const Add(double.infinity, double.infinity, double.infinity).check();
const Add(double.infinity, double.negativeInfinity, double.nan).check();
const Add(double.negativeInfinity, double.infinity, double.nan).check();
const Add(double.negativeInfinity, double.negativeInfinity,
double.negativeInfinity)
.check();
const Add(
double.negativeInfinity,
double.negativeInfinity,
double.negativeInfinity,
).check();
const Add(double.minPositive, -double.minPositive, 0.0).check();
const Add(-double.minPositive, double.minPositive, 0.0).check();
@@ -647,8 +722,11 @@ void main() {
const LessEqual(-double.maxFinite, double.nan, false).check();
const LessEqual(double.nan, double.negativeInfinity, false).check();
const LessEqual(double.negativeInfinity, double.nan, false).check();
const LessEqual(double.negativeInfinity, double.negativeInfinity, true)
.check();
const LessEqual(
double.negativeInfinity,
double.negativeInfinity,
true,
).check();
const LessEqual(double.negativeInfinity, -double.maxFinite, true).check();
const LessEqual(-double.maxFinite, double.negativeInfinity, false).check();
const LessEqual(-double.maxFinite, -double.maxFinite, true).check();
@@ -717,8 +795,11 @@ void main() {
const Greater(-double.maxFinite, double.nan, false).check();
const Greater(double.nan, double.negativeInfinity, false).check();
const Greater(double.negativeInfinity, double.nan, false).check();
const Greater(double.negativeInfinity, double.negativeInfinity, false)
.check();
const Greater(
double.negativeInfinity,
double.negativeInfinity,
false,
).check();
const Greater(double.negativeInfinity, -double.maxFinite, false).check();
const Greater(-double.maxFinite, double.negativeInfinity, true).check();
const Greater(-double.maxFinite, -double.maxFinite, false).check();
@@ -787,8 +868,11 @@ void main() {
const GreaterEqual(-double.maxFinite, double.nan, false).check();
const GreaterEqual(double.nan, double.negativeInfinity, false).check();
const GreaterEqual(double.negativeInfinity, double.nan, false).check();
const GreaterEqual(double.negativeInfinity, double.negativeInfinity, true)
.check();
const GreaterEqual(
double.negativeInfinity,
double.negativeInfinity,
true,
).check();
const GreaterEqual(double.negativeInfinity, -double.maxFinite, false).check();
const GreaterEqual(-double.maxFinite, double.negativeInfinity, true).check();
const GreaterEqual(-double.maxFinite, -double.maxFinite, true).check();
@@ -906,8 +990,11 @@ void main() {
const Identity(double.infinity, double.infinity, true).check();
const Identity(double.infinity, double.negativeInfinity, false).check();
const Identity(double.negativeInfinity, double.infinity, false).check();
const Identity(double.negativeInfinity, double.negativeInfinity, true)
.check();
const Identity(
double.negativeInfinity,
double.negativeInfinity,
true,
).check();
const Identity(0x8000000000000000, 0x8000000000000000, true).check();
const Identity(0x8000000000000000, -9223372036854775808, false).check();
@@ -937,11 +1024,12 @@ void jsEquals(expected, actual, [String reason = ""]) {
if (expected == 0 && actual == 0) {
Expect.equals(
expected.isNegative,
actual.isNegative,
(reason == null ? "" : "$reason ") +
"${expected.toString()} and "
"${actual.toString()} have different signs.");
expected.isNegative,
actual.isNegative,
(reason == null ? "" : "$reason ") +
"${expected.toString()} and "
"${actual.toString()} have different signs.",
);
}
}
@@ -953,10 +1041,16 @@ abstract class TestOp {
@pragma('dart2js:noInline')
checkAll(evalResult) {
jsEquals(expected, result,
"Frontend constant evaluation does not yield expected value.");
jsEquals(expected, evalResult,
"Backend constant evaluation does not yield expected value.");
jsEquals(
expected,
result,
"Frontend constant evaluation does not yield expected value.",
);
jsEquals(
expected,
evalResult,
"Backend constant evaluation does not yield expected value.",
);
jsEquals(expected, eval(), "eval() does not yield expected value.");
}
@@ -1049,7 +1143,7 @@ class ShiftLeft extends TestOp {
final arg2;
const ShiftLeft(this.arg1, this.arg2, expected)
: super(expected, arg1 << arg2);
: super(expected, arg1 << arg2);
@pragma('dart2js:tryInline')
check() => checkAll(eval());
@@ -1064,7 +1158,7 @@ class ShiftRight extends TestOp {
final arg2;
const ShiftRight(this.arg1, this.arg2, expected)
: super(expected, arg1 >> arg2);
: super(expected, arg1 >> arg2);
@pragma('dart2js:tryInline')
check() => checkAll(eval());
@@ -1079,7 +1173,7 @@ class BooleanAnd extends TestOp {
final arg2;
const BooleanAnd(this.arg1, this.arg2, expected)
: super(expected, arg1 && arg2);
: super(expected, arg1 && arg2);
@pragma('dart2js:tryInline')
check() => checkAll(eval());
@@ -1094,7 +1188,7 @@ class BooleanOr extends TestOp {
final arg2;
const BooleanOr(this.arg1, this.arg2, expected)
: super(expected, arg1 || arg2);
: super(expected, arg1 || arg2);
@pragma('dart2js:tryInline')
check() => checkAll(eval());
@@ -1151,7 +1245,7 @@ class TruncatingDivide extends TestOp {
final arg2;
const TruncatingDivide(this.arg1, this.arg2, expected)
: super(expected, arg1 ~/ arg2);
: super(expected, arg1 ~/ arg2);
@pragma('dart2js:tryInline')
check() => checkAll(eval());
@@ -1206,7 +1300,7 @@ class LessEqual extends TestOp {
final arg2;
const LessEqual(this.arg1, this.arg2, expected)
: super(expected, arg1 <= arg2);
: super(expected, arg1 <= arg2);
@pragma('dart2js:tryInline')
check() => checkAll(eval());
@@ -1233,7 +1327,7 @@ class GreaterEqual extends TestOp {
final arg2;
const GreaterEqual(this.arg1, this.arg2, expected)
: super(expected, arg1 >= arg2);
: super(expected, arg1 >= arg2);
@pragma('dart2js:tryInline')
check() => checkAll(eval());
@@ -1260,7 +1354,7 @@ class Identity extends TestOp {
final arg2;
const Identity(this.arg1, this.arg2, expected)
: super(expected, identical(arg1, arg2));
: super(expected, identical(arg1, arg2));
@pragma('dart2js:tryInline')
check() => checkAll(eval());
@@ -12,16 +12,13 @@ class Color {
class ColorHaver {
const ColorHaver({this.color = const Color(0xFF000000)})
: assert(color != null);
: assert(color != null);
final Color color;
}
const c = const ColorHaver(color: const Color(0xFF00FF00));
enum Enum {
a,
b,
}
enum Enum { a, b }
class EnumHaver {
const EnumHaver({this.myEnum = Enum.a}) : assert(myEnum != null);
@@ -2,7 +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.
// Tests that generic function type bounds are walked as dependencies of a
// closure. If the generic function bounds are not visited, SystemMessage is
// placed in the main unit while it's superclass GeneratedMessage is placed in a
@@ -2,7 +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.
// Tests that closure signatures are walked as dependencies of a closure. If the
// signature of the closure is not visited, SystemMessage is placed in the main
// unit while it's superclass GeneratedMessage is placed in a deferred part.
@@ -13,6 +13,6 @@
import 'default_arg_is_tearoff_lib.dart' deferred as lib;
main() => lib.loadLibrary().then((_) {
// Call via Function.apply to ensure he metadata is generated
Function.apply(lib.myFunction, []);
});
// Call via Function.apply to ensure he metadata is generated
Function.apply(lib.myFunction, []);
});
@@ -18,9 +18,9 @@ class A {
final int x;
const A(bool foo)
// The deferred task would crash trying to compute the value here, where
// [foo] is a free variable.
: x = foo ? 1 : 0;
// The deferred task would crash trying to compute the value here, where
// [foo] is a free variable.
: x = foo ? 1 : 0;
}
main() => const A(true);
@@ -4,13 +4,19 @@
defaultArg3() => "3b";
defaultArg4() => "4b";
myFunction3(positional1, positional2,
{argumentName3 = defaultArg3, argumentName4 = defaultArg4}) =>
"$positional1 $positional2 ${argumentName3()} - ${argumentName4()}";
myFunction3(
positional1,
positional2, {
argumentName3 = defaultArg3,
argumentName4 = defaultArg4,
}) => "$positional1 $positional2 ${argumentName3()} - ${argumentName4()}";
myFunction4(positional1, positional2,
{argumentName5 = const X(5), argumentName6}) =>
argumentName5.value;
myFunction4(
positional1,
positional2, {
argumentName5 = const X(5),
argumentName6,
}) => argumentName5.value;
class X {
final int value;
@@ -21,31 +21,43 @@ main() {
await lib2.loadLibrary();
Expect.equals(
Function.apply(lib1.myFunction1, [], {#argumentName1: () => "A"}),
"A - 2");
Function.apply(lib1.myFunction1, [], {#argumentName1: () => "A"}),
"A - 2",
);
Expect.equals(
Function.apply(lib2.myFunction2, [], {#argumentName4: () => "B"}),
"3 - B");
Function.apply(lib2.myFunction2, [], {#argumentName4: () => "B"}),
"3 - B",
);
await lib3.loadLibrary();
Expect.equals(
Function.apply(
lib3.myFunction3, ["x", "y"], {#argumentName4: () => "C"}),
"x y 3b - C");
Function.apply(lib3.myFunction3, ["x", "y"], {#argumentName4: () => "C"}),
"x y 3b - C",
);
Expect.equals(
Function.apply(lib3.myFunction3, ["x", "y"], {}), "x y 3b - 4b");
Function.apply(lib3.myFunction3, ["x", "y"], {}),
"x y 3b - 4b",
);
Expect.equals(Function.apply(lib3.myFunction4, ["x", "y"], {}), 5);
Expect.equals(
Function.apply(
lib3.myFunction4, ["x", "y"], {#argumentName5: new lib3.X(4)}),
4);
Function.apply(
lib3.myFunction4,
["x", "y"],
{#argumentName5: new lib3.X(4)},
),
4,
);
Expect.equals(
Function.apply(
lib3.myFunction4, ["x", "y"], {#argumentName5: lib3.value3}),
3);
Function.apply(
lib3.myFunction4,
["x", "y"],
{#argumentName5: lib3.value3},
),
3,
);
});
}
+21 -12
View File
@@ -40,19 +40,28 @@ main() {
}
load = replacement;
}
"""
""",
]);
asyncStart();
lib.loadLibrary().then((_) {
Expect.fail("Library should not have loaded");
}, onError: (error) {
lib.loadLibrary().then((_) {
Expect.equals("loaded", lib.foo());
}, onError: (error) {
Expect.fail("Library should have loaded this time");
}).whenComplete(() {
asyncEnd();
});
});
lib.loadLibrary().then(
(_) {
Expect.fail("Library should not have loaded");
},
onError: (error) {
lib
.loadLibrary()
.then(
(_) {
Expect.equals("loaded", lib.foo());
},
onError: (error) {
Expect.fail("Library should have loaded this time");
},
)
.whenComplete(() {
asyncEnd();
});
},
);
}
@@ -9,9 +9,7 @@ import "package:expect/expect.dart";
const String? maybe = bool.fromEnvironment("not there") ? "string" : null;
extension type const Ext._(String _) implements String {
const Ext()
: assert(maybe != null, "Must not be null"),
_ = "OK";
const Ext() : assert(maybe != null, "Must not be null"), _ = "OK";
}
void main() {
+4 -6
View File
@@ -37,9 +37,7 @@ class MyIterable<T> extends IterableBase<T> {
class MyListIterator<T> implements Iterator<T> {
final List<T> values;
int index;
MyListIterator(List<T> values)
: this.values = values,
index = -1;
MyListIterator(List<T> values) : this.values = values, index = -1;
bool moveNext() => ++index < values.length;
T get current {
@@ -61,8 +59,8 @@ void main() {
// Several nested for-in's.
for (var x in [
[
["a"]
]
["a"],
],
]) {
for (var y in x) {
for (var z in y) {
@@ -74,7 +72,7 @@ void main() {
// Simultaneous iteration of the same iterable.
for (var iterable in [
[1, 2, 3],
new MyIterable([1, 2, 3])
new MyIterable([1, 2, 3]),
]) {
int result = 0;
for (var x in iterable) {
@@ -10,8 +10,12 @@ import "package:expect/expect.dart";
// The type parameter forces us to create a generator body. The call from the
// method to the body needs to correctly handle elided parameters.
Future<T> foo<T>(T Function(int, int, int) toT,
{int p1 = 0, int p2 = 1, int p3 = 2}) async {
Future<T> foo<T>(
T Function(int, int, int) toT, {
int p1 = 0,
int p2 = 1,
int p3 = 2,
}) async {
await null;
return toT(p1, p2, p3);
}
@@ -26,8 +26,9 @@ class F {
test(o) => o is C<A>;
main() {
dynamic o =
new DateTime.now().millisecondsSinceEpoch == 0 ? new F() : new E();
dynamic o = new DateTime.now().millisecondsSinceEpoch == 0
? new F()
: new E();
Expect.isTrue(test(o.m<B>()));
Expect.isFalse(test(o.m<D>()));
}
@@ -30,8 +30,10 @@ void test(dynamic object, Type type, {required bool expectTypeArguments}) {
expected = expected.substring(0, expected.indexOf('<'));
}
expected = '$expected';
Expect.isTrue(e.toString().contains(expected),
'Expected "$expected" in the message: $e');
Expect.isTrue(
e.toString().contains(expected),
'Expected "$expected" in the message: $e',
);
caught = true;
print(e);
}
+3 -1
View File
@@ -25,7 +25,9 @@ callWithDouble(value) {
main() {
Expect.throws(
() => callWithStringAndDouble('foo'), (e) => e is ArgumentError);
() => callWithStringAndDouble('foo'),
(e) => e is ArgumentError,
);
Expect.equals(42, callWithStringAndDouble(0.0));
Expect.equals(42, callWithDouble(0.0));
}
+17 -4
View File
@@ -4,12 +4,25 @@
import 'package:expect/expect.dart';
List<T?> foo<T>([T? a1, T? a2, T? a3, T? a4, T? a5, T? a6, T? a7]) =>
[a1, a2, a3, a4, a5, a6, a7];
List<T?> foo<T>([T? a1, T? a2, T? a3, T? a4, T? a5, T? a6, T? a7]) => [
a1,
a2,
a3,
a4,
a5,
a6,
a7,
];
class CC {
List<T?> bar<T, U, V>([T? a1, T? a2, T? a3, T? a4, T? a5, T? a6]) =>
[a1, a2, a3, a4, a5, a6];
List<T?> bar<T, U, V>([T? a1, T? a2, T? a3, T? a4, T? a5, T? a6]) => [
a1,
a2,
a3,
a4,
a5,
a6,
];
}
main() {
+23 -10
View File
@@ -10,8 +10,13 @@ import 'package:expect/expect.dart';
void rub(Object object, String message) {
try {
// Always fail, using non-standard operation name and verb.
HArrayFlagsCheck(object, ArrayFlags.unmodifiable,
ArrayFlags.fixedLengthCheck, 'rub', 'burnish');
HArrayFlagsCheck(
object,
ArrayFlags.unmodifiable,
ArrayFlags.fixedLengthCheck,
'rub',
'burnish',
);
Expect.fail('HArrayFlagsCheck should always throw');
} catch (e) {
Expect.equals(message, e.toString());
@@ -20,15 +25,23 @@ void rub(Object object, String message) {
main() {
rub(const [], "Unsupported operation: 'rub': Cannot burnish a constant list");
rub(List.unmodifiable([]),
"Unsupported operation: 'rub': Cannot burnish an unmodifiable list");
rub(List.filled(0, 0),
"Unsupported operation: 'rub': Cannot burnish a fixed-length list");
rub(
List.unmodifiable([]),
"Unsupported operation: 'rub': Cannot burnish an unmodifiable list",
);
rub(
List.filled(0, 0),
"Unsupported operation: 'rub': Cannot burnish a fixed-length list",
);
rub([], "Unsupported operation: 'rub': Cannot burnish a list");
rub(Uint8List(10).asUnmodifiableView(),
"Unsupported operation: 'rub': Cannot burnish an unmodifiable list");
rub(
Uint8List(10).asUnmodifiableView(),
"Unsupported operation: 'rub': Cannot burnish an unmodifiable list",
);
rub(ByteData(10).asUnmodifiableView(),
"Unsupported operation: 'rub': Cannot burnish an unmodifiable ByteData");
rub(
ByteData(10).asUnmodifiableView(),
"Unsupported operation: 'rub': Cannot burnish an unmodifiable ByteData",
);
}
@@ -2,7 +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.
import 'package:expect/expect.dart';
import 'dart:_internal' show extractTypeArguments;
@@ -2,7 +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.
import 'package:expect/expect.dart';
import 'dart:_internal' show extractTypeArguments;
@@ -2,7 +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.
import 'package:expect/expect.dart';
import 'dart:_internal' show extractTypeArguments;
@@ -61,7 +61,8 @@ main() {
testNoSuchMethodResult(Expect.throws(() => bigInt.noSuchMethod(invocation)));
testNoSuchMethodResult(
Expect.throws(() => bigIntDynamic.noSuchMethod(invocation)));
Expect.throws(() => bigIntDynamic.noSuchMethod(invocation)),
);
var noSuchMethodTearoff = bigInt.noSuchMethod;
Expect.type<dynamic Function(Invocation)>(noSuchMethodTearoff);
@@ -70,8 +71,11 @@ main() {
noSuchMethodTearoff = bigIntDynamic.noSuchMethod;
Expect.type<dynamic Function(Invocation)>(noSuchMethodTearoff);
Expect.equals(bigIntDynamic.noSuchMethod, noSuchMethodTearoff);
testNoSuchMethodResult(Expect.throws(
() => noSuchMethodTearoff(Invocation.method(Symbol(methodName), null))));
testNoSuchMethodResult(
Expect.throws(
() => noSuchMethodTearoff(Invocation.method(Symbol(methodName), null)),
),
);
/* runtimeType */
var runtimeTypeResult = bigInt.runtimeType;
@@ -66,7 +66,8 @@ main() {
testNoSuchMethodResult(Expect.throws(() => symbol.noSuchMethod(invocation)));
testNoSuchMethodResult(
Expect.throws(() => symbolDynamic.noSuchMethod(invocation)));
Expect.throws(() => symbolDynamic.noSuchMethod(invocation)),
);
var noSuchMethodTearoff = symbol.noSuchMethod;
Expect.type<dynamic Function(Invocation)>(noSuchMethodTearoff);
@@ -75,8 +76,11 @@ main() {
noSuchMethodTearoff = symbolDynamic.noSuchMethod;
Expect.type<dynamic Function(Invocation)>(noSuchMethodTearoff);
Expect.equals(symbolDynamic.noSuchMethod, noSuchMethodTearoff);
testNoSuchMethodResult(Expect.throws(
() => noSuchMethodTearoff(Invocation.method(Symbol(methodName), null))));
testNoSuchMethodResult(
Expect.throws(
() => noSuchMethodTearoff(Invocation.method(Symbol(methodName), null)),
),
);
/* runtimeType */
var runtimeTypeResult = symbol.runtimeType;
@@ -198,8 +198,10 @@ main() {
// Test that subtyping with nullability works as expected.
expect(returnJavaScriptObject is JavaScriptObject? Function(), true);
expect(returnNullableJavaScriptObject is JavaScriptObject Function(),
hasUnsoundNullSafety);
expect(
returnNullableJavaScriptObject is JavaScriptObject Function(),
hasUnsoundNullSafety,
);
// Test that JavaScriptObject can be used in place of package:js types in
// function types, and vice versa.
@@ -222,30 +224,44 @@ main() {
// Dart implementation <: JS type <: JavaScriptObject
expect(returnImpl is JavaScriptObject Function(), false /* true */);
// UnknownJavaScriptObject <: JavaScriptObject <: JS type <: Dart interface
expect(returnUnknownJavaScriptObject is InterfaceClass Function(),
false /* true */);
expect(
returnUnknownJavaScriptObject is InterfaceClass Function(),
false /* true */,
);
// Dart implementation <: JS type <: JavaScriptObject <: JSObject
expect(returnImpl is JSObject Function(), false /* true */);
// Run above subtype checks but at runtime.
expect(confuse(returnJavaScriptObject) is JavaScriptObject? Function(), true);
expect(confuse(returnNullableJavaScriptObject) is JavaScriptObject Function(),
hasUnsoundNullSafety);
expect(
confuse(returnNullableJavaScriptObject) is JavaScriptObject Function(),
hasUnsoundNullSafety,
);
expect(
confuse(returnJavaScriptObject) is JSClass Function(), false /* true */);
confuse(returnJavaScriptObject) is JSClass Function(),
false /* true */,
);
expect(confuse(returnJS) is JavaScriptObject Function(), true);
expect(confuse(returnJavaScriptObject) is AnonymousClass Function(),
false /* true */);
expect(
confuse(returnJavaScriptObject) is AnonymousClass Function(),
false /* true */,
);
expect(confuse(returnAnon) is JavaScriptObject Function(), true);
expect(confuse(returnUnknownJavaScriptObject) is JSClass Function(),
isDart2JS /* true */);
expect(
confuse(returnUnknownJavaScriptObject) is JSClass Function(),
isDart2JS /* true */,
);
expect(confuse(returnJS) is JSObject Function(), true);
expect(confuse(returnJavaScriptObject) is InterfaceClass Function(),
false /* true */);
expect(
confuse(returnJavaScriptObject) is InterfaceClass Function(),
false /* true */,
);
expect(confuse(returnImpl) is JavaScriptObject Function(), false /* true */);
expect(confuse(returnUnknownJavaScriptObject) is InterfaceClass Function(),
isDart2JS /* true */);
expect(
confuse(returnUnknownJavaScriptObject) is InterfaceClass Function(),
isDart2JS /* true */,
);
expect(confuse(returnImpl) is JSObject Function(), false /* true */);
}
+13 -7
View File
@@ -8,7 +8,9 @@ import "package:expect/expect.dart";
void checkRtiIdentical(rti.Rti rti1, rti.Rti rti2) {
var format = rti.testingRtiToString;
Expect.isTrue(
identical(rti1, rti2), 'identical(${format(rti1)}, ${format(rti2)}');
identical(rti1, rti2),
'identical(${format(rti1)}, ${format(rti2)}',
);
}
void checkToString(String expected, rti.Rti rti1) {
@@ -29,8 +31,9 @@ test1() {
checkToString('AAA<Foo, aaa, bbb>', rti1);
Expect.equals(
'binding(interface("Foo"), [interface("aaa"), interface("bbb")])',
rti.testingRtiToDebugString(env1b));
'binding(interface("Foo"), [interface("aaa"), interface("bbb")])',
rti.testingRtiToDebugString(env1b),
);
// Extend environment in two steps
var env2a = rti.testingUniverseEval(universe, 'Foo');
@@ -42,11 +45,14 @@ test1() {
var rti2 = rti.testingEnvironmentEval(universe, env2c, 'AAA<0,1,2>');
checkToString('AAA<Foo, aaa, bbb>', rti2);
Expect.equals('binding(interface("Foo"), [interface("aaa")])',
rti.testingRtiToDebugString(env2b));
Expect.equals(
'binding(interface("Foo"), [interface("aaa"), interface("bbb")])',
rti.testingRtiToDebugString(env2c));
'binding(interface("Foo"), [interface("aaa")])',
rti.testingRtiToDebugString(env2b),
);
Expect.equals(
'binding(interface("Foo"), [interface("aaa"), interface("bbb")])',
rti.testingRtiToDebugString(env2c),
);
checkRtiIdentical(env1b, env2c);
}
@@ -8,7 +8,9 @@ import "package:expect/expect.dart";
void checkRtiIdentical(rti.Rti rti1, rti.Rti rti2) {
var format = rti.testingRtiToString;
Expect.isTrue(
identical(rti1, rti2), 'identical(${format(rti1)}, ${format(rti2)}');
identical(rti1, rti2),
'identical(${format(rti1)}, ${format(rti2)}',
);
}
void checkToString(String expected, rti.Rti rti1) {
@@ -8,7 +8,9 @@ import "package:expect/expect.dart";
void checkRtiIdentical(rti.Rti rti1, rti.Rti rti2) {
var format = rti.testingRtiToString;
Expect.isTrue(
identical(rti1, rti2), 'identical(${format(rti1)}, ${format(rti2)}');
identical(rti1, rti2),
'identical(${format(rti1)}, ${format(rti2)}',
);
}
void checkToString(String expected, rti.Rti rti1) {
@@ -52,18 +52,26 @@ main() {
// Subtype may not redeclare optional parameters as required
rti2 = rti.testingUniverseEval(universe, "@(A,{a!A,b!A,c!A})");
Expect.equals(
hasUnsoundNullSafety, rti.testingIsSubtype(universe, rti2, rti1));
hasUnsoundNullSafety,
rti.testingIsSubtype(universe, rti2, rti1),
);
// Subtype may not declare new required named parameters
rti2 = rti.testingUniverseEval(universe, "@(A,{a!A,b:A,c!A,d!A})");
Expect.equals(
hasUnsoundNullSafety, rti.testingIsSubtype(universe, rti2, rti1));
hasUnsoundNullSafety,
rti.testingIsSubtype(universe, rti2, rti1),
);
// Rti.toString() appears as expected
Expect.equals('(B, {required B a, B b, required B c}) => dynamic',
rti.testingRtiToString(rti1));
Expect.equals(
'(B, {required B a, B b, required B c}) => dynamic',
rti.testingRtiToString(rti1),
);
// Rti debug string properly annotates all required parameters
Expect.equals(
2, 'required'.allMatches(rti.testingRtiToDebugString(rti1)).length);
2,
'required'.allMatches(rti.testingRtiToDebugString(rti1)).length,
);
}
@@ -19,8 +19,10 @@ make2<A, B>(A a) {
class C<A> {
final A a;
C(this.a);
make<B>() => (B b) => a;
make2<B>() => (B b) => 'x';
make<B>() =>
(B b) => a;
make2<B>() =>
(B b) => 'x';
}
main() {
+4 -1
View File
@@ -32,7 +32,10 @@ final typeRules = JS('=Object', 'JSON.parse(#)', typeRulesJson);
main() {
rti.testingAddRules(universe, typeRules);
rti.testingUniverseEvalOverride(
universe, nullableObject, TYPE_REF<Object?>());
universe,
nullableObject,
TYPE_REF<Object?>(),
);
rti.testingUniverseEvalOverride(universe, objectName, TYPE_REF<Object>());
rti.testingUniverseEvalOverride(universe, nullName, TYPE_REF<Null>());
runTests();
@@ -16,7 +16,8 @@ const typeRulesJson = r'''
''';
final typeRules = JS('=Object', 'JSON.parse(#)', typeRulesJson);
const typeParameterVariancesJson = '''
const typeParameterVariancesJson =
'''
{
"Covariant": [${rti.Variance.covariant}],
"Contravariant": [${rti.Variance.contravariant}],
@@ -25,8 +26,11 @@ const typeParameterVariancesJson = '''
${rti.Variance.contravariant}, ${rti.Variance.covariant}]
}
''';
final typeParameterVariances =
JS('=Object', 'JSON.parse(#)', typeParameterVariancesJson);
final typeParameterVariances = JS(
'=Object',
'JSON.parse(#)',
typeParameterVariancesJson,
);
main() {
rti.testingAddRules(universe, typeRules);
@@ -43,5 +47,7 @@ void testInterfacesWithVariance() {
unrelated('Invariant<int>', 'Invariant<num>');
unrelated('Invariant<num>', 'Invariant<int>');
strictSubtype(
'MultiVariant<int,num,num,int>', 'MultiVariant<num,num,int,num>');
'MultiVariant<int,num,num,int>',
'MultiVariant<num,num,int,num>',
);
}
+29 -8
View File
@@ -21,7 +21,8 @@ Error? getError(action(), name, part) {
}
indexErrorContainsIndex() {
makeFault(i) => () => confuse([])[i];
makeFault(i) =>
() => confuse([])[i];
var name = 'index error contains index';
var e1 = getError(makeFault(1234), name, 'small');
@@ -93,7 +94,11 @@ constantIndexHugeEmpty() {
}
compare(
'constant index on empty list with huge index', fault1, fault2, fault3);
'constant index on empty list with huge index',
fault1,
fault2,
fault3,
);
}
constantIndexNonempty() {
@@ -135,8 +140,12 @@ constantIndexHugeNonempty() {
return [a[HUGE], a[1], a[2]];
}
compare('constant index on non-empty list with huge index', fault1, fault2,
fault3);
compare(
'constant index on non-empty list with huge index',
fault1,
fault2,
fault3,
);
}
constantIndexSetEmpty() {
@@ -233,7 +242,11 @@ variableIndexNonempty(index, qualifier) {
}
compare(
'variable index on non-empty list $qualifier', fault1, fault2, fault3);
'variable index on non-empty list $qualifier',
fault1,
fault2,
fault3,
);
}
variableIndexSetEmpty(index, qualifier) {
@@ -263,7 +276,11 @@ variableIndexSetEmpty(index, qualifier) {
}
compare(
'variable index-set on empty list $qualifier', fault1, fault2, fault3);
'variable index-set on empty list $qualifier',
fault1,
fault2,
fault3,
);
}
variableIndexSetNonempty(index, qualifier) {
@@ -292,8 +309,12 @@ variableIndexSetNonempty(index, qualifier) {
return a;
}
compare('variable index-set on non-empty list $qualifier', fault1, fault2,
fault3);
compare(
'variable index-set on non-empty list $qualifier',
fault1,
fault2,
fault3,
);
}
main() {
+4 -3
View File
@@ -36,11 +36,12 @@ void main() {
window.PackageJSClass = function PackageJSClass(x) {
this.x = x;
};
"""
""",
]);
var instance =
TestGenericClass<PackageJSClass<JSString>>(PackageJSClass("Hello".toJS));
var instance = TestGenericClass<PackageJSClass<JSString>>(
PackageJSClass("Hello".toJS),
);
print(instance.directCast(PackageJSClass("Hello".toJS)));
print(instance.typeArgCast(PackageJSClass("Hello".toJS)));
}
@@ -14,8 +14,14 @@ import "package:expect/expect.dart";
@JS()
@anonymous
class Margins {
external factory Margins(
{int top, int start, int end, int right, int bottom, int left});
external factory Margins({
int top,
int start,
int end,
int right,
int bottom,
int left,
});
external int get top;
external int get right;
external int get left;
+174 -62
View File
@@ -209,7 +209,7 @@ class AnotherClass {
@pragma('dart2js:prefer-inline')
external static double Function()
get staticGetterFunctionReturnsUndefinedInlined;
get staticGetterFunctionReturnsUndefinedInlined;
@pragma('dart2js:never-inline')
external static bool staticNullField;
@@ -315,7 +315,7 @@ class NamedClass {
@pragma('dart2js:prefer-inline')
external static double Function()
get staticGetterFunctionReturnsUndefinedInlined;
get staticGetterFunctionReturnsUndefinedInlined;
@pragma('dart2js:never-inline')
external bool nullField;
@@ -412,8 +412,10 @@ void topLevelMemberTests({required bool checksEnabled}) {
var getterFunction = getterFunctionReturnsNull;
Expect.isNull(getterFunction());
eval(r'self.getterFunctionReturnsUndefined = function() { '
'return void 0; };');
eval(
r'self.getterFunctionReturnsUndefined = function() { '
'return void 0; };',
);
Expect.isNull(getterFunctionReturnsUndefined());
getterFunction = getterFunctionReturnsUndefined;
Expect.isNull(getterFunction());
@@ -461,8 +463,10 @@ void inlinedTopLevelMemberTests({required bool checksEnabled}) {
var getterFunction = getterFunctionReturnsNullInlined;
Expect.isNull(getterFunction());
eval(r'self.getterFunctionReturnsUndefinedInlined = function() { '
'return void 0; };');
eval(
r'self.getterFunctionReturnsUndefinedInlined = function() { '
'return void 0; };',
);
Expect.isNull(getterFunctionReturnsUndefinedInlined());
getterFunction = getterFunctionReturnsUndefinedInlined;
Expect.isNull(getterFunction());
@@ -560,9 +564,13 @@ void anonymousClassTests({required bool checksEnabled}) {
// Immediate invocations of instance getters are seen as function calls so
// the results get checked.
Expect.throwsTypeErrorWhen(
checksEnabled, () => x.getterFunctionReturnsNull());
checksEnabled,
() => x.getterFunctionReturnsNull(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => x.getterFunctionReturnsUndefined());
checksEnabled,
() => x.getterFunctionReturnsUndefined(),
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -581,16 +589,22 @@ void anonymousClassTests({required bool checksEnabled}) {
Expect.isNull(x.nullableField);
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticReturnsNull());
checksEnabled,
() => AnotherClass.staticReturnsNull(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticReturnsUndefined());
checksEnabled,
() => AnotherClass.staticReturnsUndefined(),
);
functionTearoff = AnotherClass.staticReturnsNull;
Expect.throwsTypeErrorWhen(checksEnabled, () => functionTearoff());
functionTearoff = AnotherClass.staticReturnsUndefined;
Expect.throwsTypeErrorWhen(checksEnabled, () => functionTearoff());
Expect.throwsTypeErrorWhen(checksEnabled, () => AnotherClass.staticGetsNull);
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticUndefinedGetter);
checksEnabled,
() => AnotherClass.staticUndefinedGetter,
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -605,7 +619,9 @@ void anonymousClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(checksEnabled, () => AnotherClass.staticNullField);
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticUndefinedField);
checksEnabled,
() => AnotherClass.staticUndefinedField,
);
Expect.isNull(AnotherClass.staticNullableFunction());
Expect.isNull(AnotherClass.staticNullableGetter);
@@ -634,9 +650,13 @@ void inlinedAnonymousClassTests({required bool checksEnabled}) {
// Immediate invocations of instance getters are seen as function calls so
// the results get checked.
Expect.throwsTypeErrorWhen(
checksEnabled, () => x.getterFunctionReturnsNullInlined());
checksEnabled,
() => x.getterFunctionReturnsNullInlined(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => x.getterFunctionReturnsUndefinedInlined());
checksEnabled,
() => x.getterFunctionReturnsUndefinedInlined(),
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -655,17 +675,25 @@ void inlinedAnonymousClassTests({required bool checksEnabled}) {
Expect.isNull(x.nullableFieldInlined);
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticReturnsNullInlined());
checksEnabled,
() => AnotherClass.staticReturnsNullInlined(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticReturnsUndefinedInlined());
checksEnabled,
() => AnotherClass.staticReturnsUndefinedInlined(),
);
functionTearoff = AnotherClass.staticReturnsNullInlined;
Expect.throwsTypeErrorWhen(checksEnabled, () => functionTearoff());
functionTearoff = AnotherClass.staticReturnsUndefinedInlined;
Expect.throwsTypeErrorWhen(checksEnabled, () => functionTearoff());
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticGetsNullInlined);
checksEnabled,
() => AnotherClass.staticGetsNullInlined,
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticUndefinedGetterInlined);
checksEnabled,
() => AnotherClass.staticUndefinedGetterInlined,
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -679,9 +707,13 @@ void inlinedAnonymousClassTests({required bool checksEnabled}) {
Expect.isNull(getterFunction());
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticNullFieldInlined);
checksEnabled,
() => AnotherClass.staticNullFieldInlined,
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => AnotherClass.staticUndefinedFieldInlined);
checksEnabled,
() => AnotherClass.staticUndefinedFieldInlined,
);
Expect.isNull(AnotherClass.staticNullableFunctionInlined());
Expect.isNull(AnotherClass.staticNullableGetterInlined);
@@ -697,7 +729,9 @@ void dynamicAnonymousClassTests({required bool checksEnabled}) {
obj = createSomeClass();
Expect.throwsTypeErrorWhen(dart2js && checksEnabled, () => obj.returnsNull());
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.returnsUndefined());
dart2js && checksEnabled,
() => obj.returnsUndefined(),
);
// In dart2js, a tearoff of an interop method is indistinguishable from a
// getter returning the underlying function.
@@ -708,14 +742,20 @@ void dynamicAnonymousClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(dart2js && checksEnabled, () => obj.getsNull);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.undefinedGetter);
dart2js && checksEnabled,
() => obj.undefinedGetter,
);
// Immediate invocations of instance getters are seen as function calls so
// the results get checked.
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.getterFunctionReturnsNull());
dart2js && checksEnabled,
() => obj.getterFunctionReturnsNull(),
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.getterFunctionReturnsUndefined());
dart2js && checksEnabled,
() => obj.getterFunctionReturnsUndefined(),
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -728,7 +768,9 @@ void dynamicAnonymousClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(dart2js && checksEnabled, () => obj.nullField);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.undefinedField);
dart2js && checksEnabled,
() => obj.undefinedField,
);
Expect.isNull(obj.nullableFunction());
Expect.isNull(obj.nullableGetter);
@@ -743,9 +785,13 @@ void dynamicInlinedAnonymousClassTests({required bool checksEnabled}) {
obj = createSomeClass();
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.returnsNullInlined());
dart2js && checksEnabled,
() => obj.returnsNullInlined(),
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.returnsUndefinedInlined());
dart2js && checksEnabled,
() => obj.returnsUndefinedInlined(),
);
// In dart2js, a tearoff of an interop method is indistinguishable from a
// getter returning the underlying function.
@@ -755,16 +801,24 @@ void dynamicInlinedAnonymousClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(false, () => functionTearoff());
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.getsNullInlined);
dart2js && checksEnabled,
() => obj.getsNullInlined,
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.undefinedGetterInlined);
dart2js && checksEnabled,
() => obj.undefinedGetterInlined,
);
// Immediate invocations of instance getters are seen as function calls so
// the results get checked.
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.getterFunctionReturnsNullInlined());
Expect.throwsTypeErrorWhen(dart2js && checksEnabled,
() => obj.getterFunctionReturnsUndefinedInlined());
dart2js && checksEnabled,
() => obj.getterFunctionReturnsNullInlined(),
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled,
() => obj.getterFunctionReturnsUndefinedInlined(),
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -776,9 +830,13 @@ void dynamicInlinedAnonymousClassTests({required bool checksEnabled}) {
Expect.isNull(getterFunction());
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.nullFieldInlined);
dart2js && checksEnabled,
() => obj.nullFieldInlined,
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.undefinedFieldInlined);
dart2js && checksEnabled,
() => obj.undefinedFieldInlined,
);
Expect.isNull(obj.nullableFunctionInlined());
Expect.isNull(obj.nullableGetterInlined);
@@ -856,9 +914,13 @@ void namedClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(ddc && checksEnabled, () => functionTearoff());
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticReturnsNull());
checksEnabled,
() => NamedClass.staticReturnsNull(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticReturnsUndefined());
checksEnabled,
() => NamedClass.staticReturnsUndefined(),
);
functionTearoff = NamedClass.staticReturnsNull;
Expect.throwsTypeErrorWhen(checksEnabled, () => functionTearoff());
functionTearoff = NamedClass.staticReturnsUndefined;
@@ -868,12 +930,18 @@ void namedClassTests({required bool checksEnabled}) {
// Immediate invocations of instance getters are seen as function calls so
// the results get checked.
Expect.throwsTypeErrorWhen(
checksEnabled, () => y.getterFunctionReturnsNull());
checksEnabled,
() => y.getterFunctionReturnsNull(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => y.getterFunctionReturnsUndefined());
checksEnabled,
() => y.getterFunctionReturnsUndefined(),
);
Expect.throwsTypeErrorWhen(checksEnabled, () => NamedClass.staticGetsNull);
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticUndefinedGetter);
checksEnabled,
() => NamedClass.staticUndefinedGetter,
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -894,7 +962,9 @@ void namedClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(checksEnabled, () => y.undefinedField);
Expect.throwsTypeErrorWhen(checksEnabled, () => NamedClass.staticNullField);
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticUndefinedField);
checksEnabled,
() => NamedClass.staticUndefinedField,
);
Expect.isNull(y.nullableFunction());
Expect.isNull(y.nullableGetter);
@@ -921,9 +991,13 @@ void inlinedNamedClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(ddc && checksEnabled, () => functionTearoff());
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticReturnsNullInlined());
checksEnabled,
() => NamedClass.staticReturnsNullInlined(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticReturnsUndefinedInlined());
checksEnabled,
() => NamedClass.staticReturnsUndefinedInlined(),
);
functionTearoff = NamedClass.staticReturnsNullInlined;
Expect.throwsTypeErrorWhen(checksEnabled, () => functionTearoff());
functionTearoff = NamedClass.staticReturnsUndefinedInlined;
@@ -933,13 +1007,21 @@ void inlinedNamedClassTests({required bool checksEnabled}) {
// Immediate invocations of instance getters are seen as function calls so
// the results get checked.
Expect.throwsTypeErrorWhen(
checksEnabled, () => y.getterFunctionReturnsNullInlined());
checksEnabled,
() => y.getterFunctionReturnsNullInlined(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => y.getterFunctionReturnsUndefinedInlined());
checksEnabled,
() => y.getterFunctionReturnsUndefinedInlined(),
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticGetsNullInlined);
checksEnabled,
() => NamedClass.staticGetsNullInlined,
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticUndefinedGetterInlined);
checksEnabled,
() => NamedClass.staticUndefinedGetterInlined,
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -959,9 +1041,13 @@ void inlinedNamedClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(checksEnabled, () => y.nullFieldInlined);
Expect.throwsTypeErrorWhen(checksEnabled, () => y.undefinedFieldInlined);
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticNullFieldInlined);
checksEnabled,
() => NamedClass.staticNullFieldInlined,
);
Expect.throwsTypeErrorWhen(
checksEnabled, () => NamedClass.staticUndefinedFieldInlined);
checksEnabled,
() => NamedClass.staticUndefinedFieldInlined,
);
Expect.isNull(y.nullableFunctionInlined());
Expect.isNull(y.nullableGetterInlined);
@@ -980,7 +1066,9 @@ void dynamicNamedClassTests({required bool checksEnabled}) {
obj = NamedClass.createNamedClass();
Expect.throwsTypeErrorWhen(dart2js && checksEnabled, () => obj.returnsNull());
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.returnsUndefined());
dart2js && checksEnabled,
() => obj.returnsUndefined(),
);
// In dart2js, a tearoff of an interop method is indistinguishable from a
// getter returning the underlying function.
@@ -991,13 +1079,19 @@ void dynamicNamedClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(dart2js && checksEnabled, () => obj.getsNull);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.undefinedGetter);
dart2js && checksEnabled,
() => obj.undefinedGetter,
);
// Immediate invocations of instance getters are seen as function calls so
// the results get checked.
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.getterFunctionReturnsNull());
dart2js && checksEnabled,
() => obj.getterFunctionReturnsNull(),
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.getterFunctionReturnsUndefined());
dart2js && checksEnabled,
() => obj.getterFunctionReturnsUndefined(),
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -1010,7 +1104,9 @@ void dynamicNamedClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(dart2js && checksEnabled, () => obj.nullField);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.undefinedField);
dart2js && checksEnabled,
() => obj.undefinedField,
);
Expect.isNull(obj.nullableFunction());
Expect.isNull(obj.nullableGetter);
@@ -1025,9 +1121,13 @@ void dynamicInlinedNamedClassTests({required bool checksEnabled}) {
obj = NamedClass.createNamedClass();
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.returnsNullInlined());
dart2js && checksEnabled,
() => obj.returnsNullInlined(),
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.returnsUndefinedInlined());
dart2js && checksEnabled,
() => obj.returnsUndefinedInlined(),
);
// In dart2js, a tearoff of an interop method is indistinguishable from a
// getter returning the underlying function.
@@ -1037,15 +1137,23 @@ void dynamicInlinedNamedClassTests({required bool checksEnabled}) {
Expect.throwsTypeErrorWhen(false, () => functionTearoff());
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.getsNullInlined);
dart2js && checksEnabled,
() => obj.getsNullInlined,
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.undefinedGetterInlined);
dart2js && checksEnabled,
() => obj.undefinedGetterInlined,
);
// Immediate invocations of instance getters are seen as function calls so
// the results get checked.
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.getterFunctionReturnsNullInlined());
Expect.throwsTypeErrorWhen(dart2js && checksEnabled,
() => obj.getterFunctionReturnsUndefinedInlined());
dart2js && checksEnabled,
() => obj.getterFunctionReturnsNullInlined(),
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled,
() => obj.getterFunctionReturnsUndefinedInlined(),
);
// At the time this test was written, getters that return function types don't
// get the same wrappers as function tearoffs so there isn't an opportunity to
@@ -1057,9 +1165,13 @@ void dynamicInlinedNamedClassTests({required bool checksEnabled}) {
Expect.isNull(getterFunction());
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.nullFieldInlined);
dart2js && checksEnabled,
() => obj.nullFieldInlined,
);
Expect.throwsTypeErrorWhen(
dart2js && checksEnabled, () => obj.undefinedFieldInlined);
dart2js && checksEnabled,
() => obj.undefinedFieldInlined,
);
Expect.isNull(obj.nullableFunctionInlined());
Expect.isNull(obj.nullableGetterInlined);
+1 -1
View File
@@ -23,7 +23,7 @@ main() {
function C(a){
this.isUndefined = a === undefined;
};
"""
""",
]);
Expect.isTrue(new C().isUndefined);
+1 -1
View File
@@ -16,7 +16,7 @@ main() {
this.bar = 'Foo.bar';
};
aFoo = new Foo();
"""
""",
]);
Expect.equals('Foo.bar', jsBar);
+9 -5
View File
@@ -35,7 +35,7 @@ String describeClass(Field object) {
if (object is Final) 'Final',
'Field',
if (object is Checked) 'Checked',
if (object is Trusted) 'Trusted'
if (object is Trusted) 'Trusted',
];
return '$name implements ${interfaces.join(", ")}';
@@ -47,10 +47,14 @@ void test(Field Function() factory) {
// Get the class description to ensure library name is set.
final description = describeClass(o1);
print('-- $description');
Expect.isTrue(o1 is Checked || o1 is Trusted,
'Test class must implement one of Checked or Trusted: $description');
Expect.isFalse(o1 is Checked && o1 is Trusted,
'Test class must not implement both of Checked or Trusted: $description');
Expect.isTrue(
o1 is Checked || o1 is Trusted,
'Test class must implement one of Checked or Trusted: $description',
);
Expect.isFalse(
o1 is Checked && o1 is Trusted,
'Test class must not implement both of Checked or Trusted: $description',
);
// Setter then Getter should not throw.
final o2 = factory();
+3 -1
View File
@@ -15,7 +15,9 @@ void test(int i, String expected) {
// Many nested closures with shadowing variables.
int c = 0;
final r = List.generate(
i, (i) => List.generate(i + 1, (i) => List.generate(i + 1, (i) => ++c)));
i,
(i) => List.generate(i + 1, (i) => List.generate(i + 1, (i) => ++c)),
);
Expect.equals(expected, '$r');
}
+385 -57
View File
@@ -10,10 +10,32 @@ main() {
{
// Generates identical compile time constants.
var s1 = "abcdefgh";
var s2 = "abcd" "efgh";
var s3 = "ab" "cd" "ef" "gh";
var s4 = "a" "b" "c" "d" "e" "f" "g" "h";
var s5 = "a" 'b' r"c" r'd' """e""" '''f''' r"""g""" r'''h''';
var s2 =
"abcd"
"efgh";
var s3 =
"ab"
"cd"
"ef"
"gh";
var s4 =
"a"
"b"
"c"
"d"
"e"
"f"
"g"
"h";
var s5 =
"a"
'b'
r"c"
r'd'
"""e"""
'''f'''
r"""g"""
r'''h''';
Expect.isTrue(identical(s1, s2));
Expect.isTrue(identical(s1, s3));
Expect.isTrue(identical(s1, s4));
@@ -22,43 +44,105 @@ main() {
{
// Separating whitespace isn't necessary for the tokenizer.
var s1 = "abcdefgh";
var s2 = "abcd" "efgh";
var s3 = "ab" "cd" "ef" "gh";
var s4 = "a" "b" "c" "d" "e" "f" "g" "h";
var s5 = "a" 'b' r"c" r'd' """e""" '''f''' r"""g""" r'''h''';
var s2 =
"abcd"
"efgh";
var s3 =
"ab"
"cd"
"ef"
"gh";
var s4 =
"a"
"b"
"c"
"d"
"e"
"f"
"g"
"h";
var s5 =
"a"
'b'
r"c"
r'd'
"""e"""
'''f'''
r"""g"""
r'''h''';
Expect.isTrue(identical(s1, s2));
Expect.isTrue(identical(s1, s3));
Expect.isTrue(identical(s1, s4));
Expect.isTrue(identical(s1, s5));
// "a""""""b""" should be tokenized as "a" """""b""", aka. "a" '""b'.
Expect.isTrue(identical('a""b', "a" """""b"""));
Expect.isTrue(
identical(
'a""b',
"a"
"""""b""",
),
);
// """a""""""""b""" is 'a' '""b'.
Expect.isTrue(identical('a""b', """a""" """""b"""));
Expect.isTrue(
identical(
'a""b',
"""a"""
"""""b""",
),
);
// Raw strings.
Expect.isTrue(identical('ab', "a" r"b"));
Expect.isTrue(identical('ab', r"a" "b"));
Expect.isTrue(identical('ab', r"a" r"b"));
Expect.isTrue(
identical(
'ab',
"a"
r"b",
),
);
Expect.isTrue(
identical(
'ab',
r"a"
"b",
),
);
Expect.isTrue(
identical(
'ab',
r"a"
r"b",
),
);
}
// Newlines are just whitespace.
var ms1 = "abc"
var ms1 =
"abc"
"def"
"ghi"
"jkl";
Expect.isTrue(identical("abcdefghijkl", ms1));
// Works with multiline strings too.
var ms2 = """abc
var ms2 =
"""abc
def"""
"""
ghi
jkl
""";
Expect.isTrue(
identical("abc\n def ghi\n jkl\n ", ms2), "Multiline: $ms2");
identical("abc\n def ghi\n jkl\n ", ms2),
"Multiline: $ms2",
);
// Binds stronger than property access (it's considered one literal).
Expect.equals(5, "ab" "cde".length, "Associativity");
Expect.equals(
5,
"ab"
"cde"
.length,
"Associativity",
);
// Check that interpolations are handled correctly.
{
@@ -66,51 +150,295 @@ main() {
var y = 42;
var z = true;
String e1 = "$x$y$z";
Expect.equals(e1, "$x" "$y$z");
Expect.equals(e1, "$x$y" "$z");
Expect.equals(e1, "$x" "$y" "$z");
Expect.equals(
e1,
"$x"
"$y$z",
);
Expect.equals(
e1,
"$x$y"
"$z",
);
Expect.equals(
e1,
"$x"
"$y"
"$z",
);
String e2 = "-$x-$y-$z-";
Expect.equals(e2, "-" "$x" "-" "$y" "-" "$z" "-", "a");
Expect.equals(e2, "-$x" "-" "$y" "-" "$z" "-", "b");
Expect.equals(e2, "-" "$x-" "$y" "-" "$z" "-", "c");
Expect.equals(e2, "-" "$x" "-$y" "-" "$z" "-", "d");
Expect.equals(e2, "-" "$x" "-" "$y-" "$z" "-", "e");
Expect.equals(e2, "-" "$x" "-" "$y" "-$z" "-", "f");
Expect.equals(e2, "-" "$x" "-" "$y" "-" "$z-", "g");
Expect.equals(e2, "-" "$x-$y" "-" "$z" "-", "h");
Expect.equals(e2, "-" "$x-$y-$z" "-", "i");
Expect.equals("-$x-$y-", "-" "$x" "-" "$y" "-");
Expect.equals("-$x-$y", "-" "$x" "-" "$y");
Expect.equals("-$x$y-", "-" "$x" "$y" "-");
Expect.equals("$x-$y-", "$x" "-" "$y" "-");
Expect.equals("$x$y", "$x" "$y");
Expect.equals("$x$y", "$x" "" "$y");
Expect.equals("$x$y", "$x" "" "" "$y");
Expect.equals("$x-$y", "$x" "-" "$y");
Expect.equals("$x-$y", "$x" "-" "" "$y");
Expect.equals("$x-$y", "$x" "" "-" "$y");
Expect.equals("$x-$y", "$x" "" "-" "" "$y");
Expect.equals("$x--$y", "$x" "-" "-" "$y");
Expect.equals("$x--$y", "$x" "-" "-" "" "$y");
Expect.equals("$x--$y", "$x" "-" "" "-" "$y");
Expect.equals("$x--$y", "$x" "" "-" "-" "$y");
Expect.equals("$x---$y", "$x" "-" "-" "-" "$y");
Expect.equals("$x---", "$x" "-" "-" "-");
Expect.equals("---$y", "-" "-" "-" "$y");
Expect.equals("$x-$y-$z", "${'$x' '-' '$y'}" "-" "$z");
Expect.equals(
e2,
"-"
"$x"
"-"
"$y"
"-"
"$z"
"-",
"a",
);
Expect.equals(
e2,
"-$x"
"-"
"$y"
"-"
"$z"
"-",
"b",
);
Expect.equals(
e2,
"-"
"$x-"
"$y"
"-"
"$z"
"-",
"c",
);
Expect.equals(
e2,
"-"
"$x"
"-$y"
"-"
"$z"
"-",
"d",
);
Expect.equals(
e2,
"-"
"$x"
"-"
"$y-"
"$z"
"-",
"e",
);
Expect.equals(
e2,
"-"
"$x"
"-"
"$y"
"-$z"
"-",
"f",
);
Expect.equals(
e2,
"-"
"$x"
"-"
"$y"
"-"
"$z-",
"g",
);
Expect.equals(
e2,
"-"
"$x-$y"
"-"
"$z"
"-",
"h",
);
Expect.equals(
e2,
"-"
"$x-$y-$z"
"-",
"i",
);
Expect.equals(
r"-foo-42-true-", r"-" "$x" r"""-""" """$y""" r'-' '$z' r'''-''', "j");
"-$x-$y-",
"-"
"$x"
"-"
"$y"
"-",
);
Expect.equals(
r"-$x-42-true-", r"-" r"$x" r"""-""" """$y""" r'-' '$z' r'''-''', "k");
"-$x-$y",
"-"
"$x"
"-"
"$y",
);
Expect.equals(
r"-foo-$y-true-", r"-" "$x" r"""-""" r"""$y""" r'-' '$z' r'''-''', "l");
"-$x$y-",
"-"
"$x"
"$y"
"-",
);
Expect.equals(
r"-foo-42-$z-", r"-" "$x" r"""-""" """$y""" r'-' r'$z' r'''-''', "m");
"$x-$y-",
"$x"
"-"
"$y"
"-",
);
Expect.equals(
"$x$y",
"$x"
"$y",
);
Expect.equals(
"$x$y",
"$x"
""
"$y",
);
Expect.equals(
"$x$y",
"$x"
""
""
"$y",
);
Expect.equals(
"$x-$y",
"$x"
"-"
"$y",
);
Expect.equals(
"$x-$y",
"$x"
"-"
""
"$y",
);
Expect.equals(
"$x-$y",
"$x"
""
"-"
"$y",
);
Expect.equals(
"$x-$y",
"$x"
""
"-"
""
"$y",
);
Expect.equals(
"$x--$y",
"$x"
"-"
"-"
"$y",
);
Expect.equals(
"$x--$y",
"$x"
"-"
"-"
""
"$y",
);
Expect.equals(
"$x--$y",
"$x"
"-"
""
"-"
"$y",
);
Expect.equals(
"$x--$y",
"$x"
""
"-"
"-"
"$y",
);
Expect.equals(
"$x---$y",
"$x"
"-"
"-"
"-"
"$y",
);
Expect.equals(
"$x---",
"$x"
"-"
"-"
"-",
);
Expect.equals(
"---$y",
"-"
"-"
"-"
"$y",
);
Expect.equals(
"$x-$y-$z",
"${'$x'
'-'
'$y'}"
"-"
"$z",
);
Expect.equals(
r"-foo-42-true-",
r"-"
"$x"
r"""-"""
"""$y"""
r'-'
'$z'
r'''-''',
"j",
);
Expect.equals(
r"-$x-42-true-",
r"-"
r"$x"
r"""-"""
"""$y"""
r'-'
'$z'
r'''-''',
"k",
);
Expect.equals(
r"-foo-$y-true-",
r"-"
"$x"
r"""-"""
r"""$y"""
r'-'
'$z'
r'''-''',
"l",
);
Expect.equals(
r"-foo-42-$z-",
r"-"
"$x"
r"""-"""
"""$y"""
r'-'
r'$z'
r'''-''',
"m",
);
}
}
+5 -1
View File
@@ -5,7 +5,11 @@
void main() {
print(3 + 4 + 5);
print(3.0 + 4.0 + 5.0);
print("fisk" " " "hest");
print(
"fisk"
" "
"hest",
);
print(true);
print(false);
}
+2 -1
View File
@@ -29,7 +29,8 @@ void or4() {
}
void or5() {
if (true || false) {} else {
if (true || false) {
} else {
Expect.fail('unreachable');
}
}
+54 -46
View File
@@ -12,8 +12,14 @@ enum E { A, B, C, D }
class Z {
final a, b, c, d, e, f;
const Z(
{this.a = 1, this.b = 1, this.c = 1, this.d = 1, this.e = 1, this.f = 1});
const Z({
this.a = 1,
this.b = 1,
this.c = 1,
this.d = 1,
this.e = 1,
this.f = 1,
});
}
const c1 = const {};
@@ -60,49 +66,49 @@ const z5 = const Z(d: 3);
const z6 = const Z(d: 2);
makeAll() => {
'E.A': E.A,
'E.B': E.B,
'E.C': E.C,
'E.D': E.D,
'c1': c1,
'c2': c2,
'c3': c3,
'c4': c4,
'l1': l1,
'l2': l2,
'l3': l3,
'l4': l4,
'll1': ll1,
'll2': ll2,
'll3': ll3,
'l4': ll4,
'm1': m1,
'm2': m2,
'm3': m3,
'm4': m4,
'm5': m5,
'm6': m6,
'm7': m7,
'm8': m8,
'm9': m9,
'mA': mA,
'mB': mB,
'mC': mC,
'mE1': mE1,
'mE2': mE2,
'mE3': mE3,
'mE4': mE4,
'mE5': mE5,
'mE6': mE6,
'mE7': mE7,
'mE8': mE8,
'z1': z1,
'z2': z2,
'z3': z3,
'z4': z4,
'z5': z5,
'z6': z6,
};
'E.A': E.A,
'E.B': E.B,
'E.C': E.C,
'E.D': E.D,
'c1': c1,
'c2': c2,
'c3': c3,
'c4': c4,
'l1': l1,
'l2': l2,
'l3': l3,
'l4': l4,
'll1': ll1,
'll2': ll2,
'll3': ll3,
'l4': ll4,
'm1': m1,
'm2': m2,
'm3': m3,
'm4': m4,
'm5': m5,
'm6': m6,
'm7': m7,
'm8': m8,
'm9': m9,
'mA': mA,
'mB': mB,
'mC': mC,
'mE1': mE1,
'mE2': mE2,
'mE3': mE3,
'mE4': mE4,
'mE5': mE5,
'mE6': mE6,
'mE7': mE7,
'mE8': mE8,
'z1': z1,
'z2': z2,
'z3': z3,
'z4': z4,
'z5': z5,
'z6': z6,
};
main() {
var all1 = makeAll();
@@ -114,7 +120,9 @@ main() {
if (name1 == name2) continue;
var e2 = all2[name2];
Expect.isFalse(
identical(e1, e2), 'Different instances $name1: $e1 $name2: $e2');
identical(e1, e2),
'Different instances $name1: $e1 $name2: $e2',
);
}
}
}
+6 -3
View File
@@ -164,7 +164,8 @@ mixin F {
class G extends B with C, F {}
bool checkFields(cls) {
var blockA = cls.fieldA1 ^
var blockA =
cls.fieldA1 ^
cls.fieldA2 ^
cls.fieldA3 ^
cls.fieldA4 ^
@@ -180,7 +181,8 @@ bool checkFields(cls) {
cls.fieldD2 ^
cls.fieldD3 ^
cls.fieldD4;
var blockB = cls.fieldXA1 ^
var blockB =
cls.fieldXA1 ^
cls.fieldXA2 ^
cls.fieldXA3 ^
cls.fieldXA4 ^
@@ -196,7 +198,8 @@ bool checkFields(cls) {
cls.fieldXD2 ^
cls.fieldXD3 ^
cls.fieldXD4;
var blockC = cls.fieldYA1 ^
var blockC =
cls.fieldYA1 ^
cls.fieldYA2 ^
cls.fieldYA3 ^
cls.fieldYA4 ^
+10 -4
View File
@@ -140,14 +140,20 @@ main() {
Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
Expect.equals(2, getTagCallCount(),
'2 = 1 fresh instance + 1 uncached (+ 2 proto cached)');
Expect.equals(
2,
getTagCallCount(),
'2 = 1 fresh instance + 1 uncached (+ 2 proto cached)',
);
clearTagCallCount();
Expect.equals("aA", confuse(t1a).foo(), 't1a is T1A');
Expect.equals("bB", confuse(t1b).foo(), 't1b is T1B');
Expect.equals("cC", confuse(t1c).foo(), 't1c is T1C');
Expect.equals("dD", confuse(t1d).foo(), 't1d is T1D');
Expect.equals(1, getTagCallCount(),
'1 = 2 proto cached + 1 instance cached + 1 uncached');
Expect.equals(
1,
getTagCallCount(),
'1 = 2 proto cached + 1 instance cached + 1 uncached',
);
}
@@ -75,7 +75,7 @@ checkAll(check) {
makeA(),
makeB(),
makeC(),
makeD()
makeD(),
];
value(i) => confuse(things[i]);
+16 -12
View File
@@ -83,20 +83,22 @@ expectTypeName(expectedName, s) {
Expect.isNotNull(m);
var name = m!.group(1);
Expect.isTrue(
expectedName == name ||
name!.length <= 3 ||
name!.startsWith('minified:'),
"Is '$expectedName' or minified: '$name'");
expectedName == name || name!.length <= 3 || name!.startsWith('minified:'),
"Is '$expectedName' or minified: '$name'",
);
}
final plainJsString =
Error.safeToString(JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject));
final plainJsString = Error.safeToString(
JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject),
);
final unknownJsString =
Error.safeToString(JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject));
final unknownJsString = Error.safeToString(
JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject),
);
final interceptorString =
Error.safeToString(JS_INTERCEPTOR_CONSTANT(Interceptor));
final interceptorString = Error.safeToString(
JS_INTERCEPTOR_CONSTANT(Interceptor),
);
testDistinctInterceptors() {
// Test invariants needed for the other tests.
@@ -150,8 +152,10 @@ testNative() {
print('Q: $x ${Error.safeToString(x)}');
// We are going to get either the general interceptor or the JavaScript
// constructor.
Expect.isTrue("Instance of 'QQQQ'" == Error.safeToString(x) ||
interceptorString == Error.safeToString(x));
Expect.isTrue(
"Instance of 'QQQQ'" == Error.safeToString(x) ||
interceptorString == Error.safeToString(x),
);
x = makeR();
+7 -4
View File
@@ -45,10 +45,13 @@ main() {
events.add("scheduleMicrotask");
}).whenComplete(asyncEnd);
Expect.equals(499, a.foo(() {
events.add("closure to foo");
return 499;
}));
Expect.equals(
499,
a.foo(() {
events.add("closure to foo");
return 499;
}),
);
events.add("after native call");
Expect.listEquals(["closure to foo", "after native call"], events);
+19 -4
View File
@@ -21,15 +21,30 @@ foreign2() {
}
foreign11(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) {
return JS("num|String", r"# + # + # + # + # + # + # + # + # + # + #", a1, a2,
a3, a4, a5, a6, a7, a8, a9, a10, a11);
return JS(
"num|String",
r"# + # + # + # + # + # + # + # + # + # + #",
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
);
}
void main() {
Expect.equals(9, foreign1(4, 5));
Expect.equals(998, foreign2());
Expect.equals('1234567891011',
foreign11('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'));
Expect.equals(
'1234567891011',
foreign11('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'),
);
// Ensure there will be isNaN and NaN variable names.
var isNaN = called ? 42 : 44;
var NaN = called ? 52 : 54;
+3 -2
View File
@@ -8,8 +8,9 @@ import 'dart:_foreign_helper' show JS, JS_CONST;
test1() {
var re = const JS_CONST(r'/-([\da-z])/ig');
var fToUpper =
const JS_CONST(r'function(_, letter){return letter.toUpperCase()}');
var fToUpper = const JS_CONST(
r'function(_, letter){return letter.toUpperCase()}',
);
var s1 = '-hello-world';
var s2 = JS('String', r'#.replace(#, #)', s1, re, fToUpper);
Expect.equals('HelloWorld', s2);
+3 -1
View File
@@ -20,7 +20,9 @@ import 'native_testing.dart';
@pragma('dart2js:noInline')
checkString(r) {
Expect.isTrue(
r is String, 'Expected string, found ${r} of type ${r.runtimeType}');
r is String,
'Expected string, found ${r} of type ${r.runtimeType}',
);
}
test1() {
+2 -1
View File
@@ -50,7 +50,8 @@ void setup() {
applyTestExtensions(['A']);
}
/*A*/ makeA() native;
/*A*/
makeA() native;
main() {
nativeTesting();
@@ -84,14 +84,18 @@ void setup() {
void match(String s, String pattern1) {
var pattern2 = pattern1.replaceAll(' ', '');
Expect.isTrue(s.contains(pattern1) || s.contains(pattern2),
"expected $pattern1 or $pattern2 in '$s'");
Expect.isTrue(
s.contains(pattern1) || s.contains(pattern2),
"expected $pattern1 or $pattern2 in '$s'",
);
}
void nomatch(String s, String pattern1) {
var pattern2 = pattern1.replaceAll(' ', '');
Expect.isFalse(s.contains(pattern1) || s.contains(pattern2),
"should not have $pattern1 or $pattern2 in '$s'");
Expect.isFalse(
s.contains(pattern1) || s.contains(pattern2),
"should not have $pattern1 or $pattern2 in '$s'",
);
}
test1() {
@@ -49,7 +49,9 @@ main() {
A a = makeA();
Expect.equals("A-foo", a.foo());
Expect.throws(
() => (a as dynamic).bar(), (error) => error is NoSuchMethodError);
() => (a as dynamic).bar(),
(error) => error is NoSuchMethodError,
);
Expect.equals("A-baz", a.baz());
Expect.isTrue(a is A);
Expect.isFalse(a is B);
@@ -68,7 +70,9 @@ main() {
M1 m1 = new M1();
Expect.equals("M1-foo", m1.foo());
Expect.throws(
() => (m1 as dynamic).bar(), (error) => error is NoSuchMethodError);
() => (m1 as dynamic).bar(),
(error) => error is NoSuchMethodError,
);
Expect.equals("M1-baz", m1.baz());
Expect.isFalse(m1 is A);
Expect.isFalse(m1 is B);
@@ -78,9 +82,13 @@ main() {
M2 m2 = new M2();
Expect.equals("M2-foo", m2.foo());
Expect.throws(
() => (m2 as dynamic).bar(), (error) => error is NoSuchMethodError);
() => (m2 as dynamic).bar(),
(error) => error is NoSuchMethodError,
);
Expect.throws(
() => (m2 as dynamic).baz(), (error) => error is NoSuchMethodError);
() => (m2 as dynamic).baz(),
(error) => error is NoSuchMethodError,
);
Expect.isFalse(m2 is A);
Expect.isFalse(m2 is B);
Expect.isFalse(m2 is M1);
+6 -2
View File
@@ -45,7 +45,9 @@ main() {
A a = makeA();
Expect.equals("A-foo", a.foo());
Expect.throws(
() => (a as dynamic).bar(), (error) => error is NoSuchMethodError);
() => (a as dynamic).bar(),
(error) => error is NoSuchMethodError,
);
Expect.equals("A-baz", a.baz());
Expect.isTrue(a is A);
Expect.isFalse(a is B);
@@ -63,7 +65,9 @@ main() {
Expect.equals("M-foo", m.foo());
Expect.equals("M-bar", m.bar());
Expect.throws(
() => (m as dynamic).baz(), (error) => error is NoSuchMethodError);
() => (m as dynamic).baz(),
(error) => error is NoSuchMethodError,
);
Expect.isFalse(m is A);
Expect.isFalse(m is B);
Expect.isTrue(m is M);
@@ -57,9 +57,13 @@ void setup() {
main() {
nativeTesting();
setup();
var things = [makeA, makeB, () => new C(), () => new D(), () => new M()]
.map((f) => f())
.toList();
var things = [
makeA,
makeB,
() => new C(),
() => new D(),
() => new M(),
].map((f) => f()).toList();
var a = things[0];
var b = things[1];
var c = things[2];
+10 -4
View File
@@ -46,8 +46,14 @@ main() {
Expect.equals('dartMethod(Goofy.nativeMethod(11))', e.dartMethod(10));
var f = makeF();
Expect.throws(() => f.nativeMethod(20), (e) => e is NoSuchMethodError,
'fake HTML Element must not run Dart method on native class');
Expect.throws(() => f.dartMethod(20), (e) => e is NoSuchMethodError,
'fake HTML Element must not run native method on native class');
Expect.throws(
() => f.nativeMethod(20),
(e) => e is NoSuchMethodError,
'fake HTML Element must not run Dart method on native class',
);
Expect.throws(
() => f.dartMethod(20),
(e) => e is NoSuchMethodError,
'fake HTML Element must not run native method on native class',
);
}
+21 -8
View File
@@ -196,18 +196,31 @@ check(func) {
print(source);
Expect.isTrue(source.contains('"in main function"'), "should contain 'main'");
Expect.isTrue(
source.contains('"in simple function"'), "should inline 'simple'");
source.contains('"in simple function"'),
"should inline 'simple'",
);
Expect.isTrue(source.contains('"in foo function"'), "should inline 'foo'");
Expect.isFalse(
source.contains('"in bar function"'), "should not inline 'bar'");
source.contains('"in bar function"'),
"should not inline 'bar'",
);
Expect.isFalse(
source.contains('"in check function"'), "should not inline 'check'");
Expect.isFalse(source.contains('"in noinline function"'),
"should not inline 'noinline'");
Expect.equals(2, new RegExp(r'\.c_field').allMatches(source).length,
"should contain r'\.c_field' exactly twice");
source.contains('"in check function"'),
"should not inline 'check'",
);
Expect.isFalse(
source.contains('.d_field'), "should not contain r'\.d_field'");
source.contains('"in noinline function"'),
"should not inline 'noinline'",
);
Expect.equals(
2,
new RegExp(r'\.c_field').allMatches(source).length,
"should contain r'\.c_field' exactly twice",
);
Expect.isFalse(
source.contains('.d_field'),
"should not contain r'\.d_field'",
);
Expect.isTrue(source.contains('"in gee function"'), "must inline 'gee'");
}
@@ -30,8 +30,8 @@ class StaticNativeClass {
factory StaticNativeClass.redirectingFactory() = StaticNativeClass;
factory StaticNativeClass.simpleFactory() => StaticNativeClass();
factory StaticNativeClass.factoryWithParam(
StaticNativeClass staticNativeClass) =>
staticNativeClass;
StaticNativeClass staticNativeClass,
) => staticNativeClass;
// This and `StaticNativeClassCopy.nestedFactory` exist to ensure that we
// cover the case where invocations on factories are visible before their
// declarations in the AST. This will test whether we correctly create the
@@ -91,8 +91,10 @@ void main() {
expect(() => null as StaticJSClass?, returnsNormally);
expect(null is StaticJSClass, false);
expect(confuse(null) is StaticJSClass, false);
expect(() => null as StaticJSClass,
hasUnsoundNullSafety ? returnsNormally : throws);
expect(
() => null as StaticJSClass,
hasUnsoundNullSafety ? returnsNormally : throws,
);
// Native objects can be interop'd with static interop classes.
expect(nativeClass is StaticNativeClass, true);
@@ -172,29 +174,39 @@ void main() {
// `JavaScriptObject Function() is JavaScriptObject Function()`. This behavior
// is similar to non-static interop classes.
expect(
returnGenericStaticJSClassInt is GenericStaticJSClass<String> Function(),
true);
returnGenericStaticJSClassInt is GenericStaticJSClass<String> Function(),
true,
);
expect(
confuse(returnGenericStaticJSClassInt) is GenericStaticJSClass<String>
Function(),
true);
confuse(returnGenericStaticJSClassInt)
is GenericStaticJSClass<String> Function(),
true,
);
expect(
() => returnGenericStaticJSClassInt as GenericStaticJSClass<String>
Function(),
returnsNormally);
() =>
returnGenericStaticJSClassInt
as GenericStaticJSClass<String> Function(),
returnsNormally,
);
// Test that nullability is respected.
expect(returnStaticJSClass is StaticJSClass? Function(), true);
expect(confuse(returnStaticJSClass) is StaticJSClass? Function(), true);
expect(returnNullableStaticJSClass is StaticJSClass Function(),
hasUnsoundNullSafety);
expect(confuse(returnNullableStaticJSClass) is StaticJSClass Function(),
hasUnsoundNullSafety);
expect(
returnNullableStaticJSClass is StaticJSClass Function(),
hasUnsoundNullSafety,
);
expect(
confuse(returnNullableStaticJSClass) is StaticJSClass Function(),
hasUnsoundNullSafety,
);
// static interop class A <: static interop class A
expect(returnStaticNativeClass is StaticNativeClass Function(), true);
expect(
confuse(returnStaticNativeClass) is StaticNativeClass Function(), true);
confuse(returnStaticNativeClass) is StaticNativeClass Function(),
true,
);
expect(returnStaticJSClass is StaticJSClass Function(), true);
expect(confuse(returnStaticJSClass) is StaticJSClass Function(), true);
@@ -43,10 +43,7 @@ class B extends A {
B.one() : super.one();
B.two()
: b1 = log(201),
b3 = log(203),
super.two() {
B.two() : b1 = log(201), b3 = log(203), super.two() {
log('body(B.two)');
}
@@ -114,8 +111,10 @@ test_two() {
Expect.equals(202, b.b2);
Expect.equals(203, b.b3);
Expect.equals('[202, 201, 101, 104, 103, 203, body(A.two), 124, body(B.two)]',
'$trace');
Expect.equals(
'[202, 201, 101, 104, 103, 203, body(A.two), 124, body(B.two)]',
'$trace',
);
}
test_three() {
+8 -8
View File
@@ -61,17 +61,17 @@ asM(x) => x as M;
setM(x) => gM = x;
checkTrue(f) => (x) {
Expect.isTrue(f(x));
};
Expect.isTrue(f(x));
};
checkFalse(f) => (x) {
Expect.isFalse(f(x));
};
Expect.isFalse(f(x));
};
checkId(f) => (x) {
Expect.identical(x, f(x));
};
Expect.identical(x, f(x));
};
checkThrows(f) => (x) {
Expect.throws(() => f(x));
};
Expect.throws(() => f(x));
};
bool get checkedMode {
try {
+7 -4
View File
@@ -11,15 +11,18 @@ class NoSuchMethodInfo {
Symbol name;
List args;
NoSuchMethodInfo(Object r, Symbol m, List a)
: receiver = r,
name = m,
args = a;
: receiver = r,
name = m,
args = a;
}
class A {
noSuchMethod(Invocation invocation) {
topLevelInfo = new NoSuchMethodInfo(
this, invocation.memberName, invocation.positionalArguments);
this,
invocation.memberName,
invocation.positionalArguments,
);
return topLevelInfo;
}
+1 -4
View File
@@ -12,10 +12,7 @@ class Annotation {
const Annotation({this.value});
}
enum Enum {
a,
b,
}
enum Enum { a, b }
class SubAnno extends Annotation {
final Enum? e;
+1 -3
View File
@@ -22,9 +22,7 @@ class A {
class B {
Loader _loader = new Loader();
load() => _loader.loadAll({
'a2': new DateTime.now(),
});
load() => _loader.loadAll({'a2': new DateTime.now()});
}
class Loader {
+2 -1
View File
@@ -7,7 +7,8 @@
import "package:expect/expect.dart";
class F {
call() => (x) => new G(x.toInt());
call() =>
(x) => new G(x.toInt());
}
class G {
+10 -3
View File
@@ -15,10 +15,17 @@ class A {
return null;
} else if (invocation.isMethod) {
return Function.apply(
method, invocation.positionalArguments, invocation.namedArguments);
method,
invocation.positionalArguments,
invocation.namedArguments,
);
} else {
throw new NoSuchMethodError(this, invocation.memberName,
invocation.positionalArguments, invocation.namedArguments);
throw new NoSuchMethodError(
this,
invocation.memberName,
invocation.positionalArguments,
invocation.namedArguments,
);
}
}
}
+6 -2
View File
@@ -35,6 +35,10 @@ void main() {
foo();
bar();
baz();
Expect.listEquals(
['foo 0 1', 'bar 0 1', 'baz-notry 0 1', 'baz-try 0 1'], trace);
Expect.listEquals([
'foo 0 1',
'bar 0 1',
'baz-notry 0 1',
'baz-try 0 1',
], trace);
}
+1 -1
View File
@@ -7,7 +7,7 @@ import 'package:expect/expect.dart';
main() {
var m1 = {
'hello': <String>['hi', 'howdy'],
'bye': <String>[]
'bye': <String>[],
};
var m = new Map<String, List<String>>.unmodifiable(m1);
print(m);
+15 -15
View File
@@ -7,21 +7,21 @@
import 'dart:async' show Future;
A<J> futureToA<T, J>(Future<T> future, [J wrapValue(T value)?]) {
return new A<J>(
(void resolveFn(J value), void rejectFn(error)) {
future.then((value) {
dynamic wrapped;
if (wrapValue != null) {
wrapped = wrapValue(value);
} else if (value != null) {
wrapped = value;
}
resolveFn(wrapped);
}).catchError((error) {
rejectFn(error);
});
},
);
return new A<J>((void resolveFn(J value), void rejectFn(error)) {
future
.then((value) {
dynamic wrapped;
if (wrapValue != null) {
wrapped = wrapValue(value);
} else if (value != null) {
wrapped = value;
}
resolveFn(wrapped);
})
.catchError((error) {
rejectFn(error);
});
});
}
class A<X> {
+3 -3
View File
@@ -37,9 +37,9 @@ mixin M on II {
// The super call causes the closure's call method's generator to have a name
// depending on the super mixin application name.
fred<T>() => (T a) async {
super.bar();
return a;
};
super.bar();
return a;
};
}
class BB implements II {
+1 -4
View File
@@ -4,9 +4,6 @@
const int x = 0;
const List<int> l = const [
1,
-x,
];
const List<int> l = const [1, -x];
main() => print(l);
+1 -1
View File
@@ -6,7 +6,7 @@
test(List a, List b) {
return [
throw 123,
{...a, ...b}
{...a, ...b},
];
}
+1 -1
View File
@@ -6,7 +6,7 @@ import 'package:expect/expect.dart';
void main() {
var v = {
...Map.unmodifiable({'x': null})
...Map.unmodifiable({'x': null}),
};
Expect.equals(null, v['x']);
}
+2 -2
View File
@@ -651,7 +651,7 @@ var a1 = [
'\u{3eaf2}\u{3eaf3}\u{3eaf4}\u{3eaf5}\u{3eaf6}\u{3eaf7}\u{3eaf8}\u{3eaf9}\u{3eafa}\u{3eafb}\u{3eafc}\u{3eafd}\u{3eafe}X\u{3eaff}\u{3eb00}\u{3eb01}\u{3eb02}\u{3eb03}\u{3eb04}\u{3eb05}\u{3eb06}\u{3eb07}\u{3eb08}\u{3eb09}\u{3eb0a}\u{3eb0b}\u{3eb0c}\u{3eb0d}\u{3eb0e}\u{3eb0f}\u{3eb10}\u{3eb11}X\u{3eb12}\u{3eb13}\u{3eb14}\u{3eb15}\u{3eb16}\u{3eb17}\u{3eb18}\u{3eb19}\u{3eb1a}\u{3eb1b}\u{3eb1c}\u{3eb1d}\u{3eb1e}\u{3eb1f}\u{3eb20}\u{3eb21}\u{3eb22}\u{3eb23}\u{3eb24}X\u{3eb25}\u{3eb26}\u{3eb27}\u{3eb28}\u{3eb29}\u{3eb2a}\u{3eb2b}\u{3eb2c}\u{3eb2d}\u{3eb2e}\u{3eb2f}\u{3eb30}\u{3eb31}\u{3eb32}\u{3eb33}\u{3eb34}\u{3eb35}\u{3eb36}\u{3eb37}X\u{3eb38}\u{3eb39}\u{3eb3a}\u{3eb3b}\u{3eb3c}\u{3eb3d}\u{3eb3e}\u{3eb3f}\u{3eb40}\u{3eb41}\u{3eb42}\u{3eb43}\u{3eb44}\u{3eb45}\u{3eb46}\u{3eb47}\u{3eb48}\u{3eb49}\u{3eb4a}X\u{3eb4b}\u{3eb4c}\u{3eb4d}\u{3eb4e}\u{3eb4f}\u{3eb50}\u{3eb51}\u{3eb52}\u{3eb53}\u{3eb54}\u{3eb55}\u{3eb56}\u{3eb57}\u{3eb58}\u{3eb59}\u{3eb5a}\u{3eb5b}\u{3eb5c}\u{3eb5d}X\u{3eb5e}\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u{3edb9}\u{3edba}\u{3edbb}\u{3edbc}\u{3edbd}X\u{3edbe}\u{3edbf}\u{3edc0}\u{3edc1}\u{3edc2}\u{3edc3}\u{3edc4}\u{3edc5}\u{3edc6}\u{3edc7}\u{3edc8}\u{3edc9}\u{3edca}\u{3edcb}\u{3edcc}\u{3edcd}\u{3edce}\u{3edcf}\u{3edd0}X\u{3edd1}\u{3edd2}\u{3edd3}\u{3edd4}\u{3edd5}\u{3edd6}\u{3edd7}\u{3edd8}\u{3edd9}\u{3edda}\u{3eddb}\u{3eddc}\u{3eddd}\u{3edde}\u{3eddf}\u{3ede0}\u{3ede1}\u{3ede2}\u{3ede3}X\u{3ede4}\u{3ede5}\u{3ede6}\u{3ede7}\u{3ede8}\u{3ede9}\u{3edea}\u{3edeb}\u{3edec}\u{3eded}\u{3edee}\u{3edef}\u{3edf0}\u{3edf1}\u{3edf2}\u{3edf3}\u{3edf4}\u{3edf5}\u{3edf6}X\u{3edf7}\u{3edf8}\u{3edf9}\u{3edfa}\u{3edfb}\u{3edfc}\u{3edfd}\u{3edfe}\u{3edff}\u{3ee00}\u{3ee01}\u{3ee02}\u{3ee03}\u{3ee04}\u{3ee05}\u{3ee06}\u{3ee07}\u{3ee08}\u{3ee09}X\u{3ee0a}\u{3ee0b}\u{3ee0c}\u{3ee0d}\u{3ee0e}\u{3ee0f}\u{3ee10}\u{3ee11}\u{3ee12}\u{3ee13}\u{3ee14}\u{3ee15}\u{3ee16}\u{3ee17}\u{3ee18}\u{3ee19}\u{3ee1a}\u{3ee1b}\u{3ee1c}X\u{3ee1d}\u{3ee1e}\u{3ee1f}\u{3ee20}\u{3ee21}\u{3ee22}\u{3ee23}\u{3ee24}\u{3ee25}\u{3ee26}\u{3ee27}\u{3ee28}\u{3ee29}\u{3ee2a}\u{3ee2b}\u{3ee2c}\u{3ee2d}\u{3ee2e}\u{3ee2f}X\u{3ee30}\u{3ee31}\u{3ee32}\u{3ee33}\u{3ee34}\u{3ee35}\u{3ee36}\u{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\u{3ef6f}\u{3ef70}\u{3ef71}\u{3ef72}X\u{3ef73}\u{3ef74}\u{3ef75}\u{3ef76}\u{3ef77}\u{3ef78}\u{3ef79}\u{3ef7a}\u{3ef7b}\u{3ef7c}\u{3ef7d}\u{3ef7e}\u{3ef7f}\u{3ef80}\u{3ef81}\u{3ef82}\u{3ef83}\u{3ef84}\u{3ef85}X\u{3ef86}\u{3ef87}\u{3ef88}\u{3ef89}\u{3ef8a}\u{3ef8b}\u{3ef8c}\u{3ef8d}\u{3ef8e}\u{3ef8f}\u{3ef90}\u{3ef91}\u{3ef92}\u{3ef93}\u{3ef94}\u{3ef95}\u{3ef96}\u{3ef97}\u{3ef98}X\u{3ef99}\u{3ef9a}\u{3ef9b}\u{3ef9c}\u{3ef9d}\u{3ef9e}\u{3ef9f}\u{3efa0}\u{3efa1}\u{3efa2}\u{3efa3}\u{3efa4}\u{3efa5}',
];
var a2 = [
@@ -1294,5 +1294,5 @@ var a2 = [
'\u{102ad}\u{102ae}\u{102af}\u{102b0}\u{102b1}\u{102b2}\u{102b3}\u{102b4}\u{102b5}\u{102b6}\u{102b7}\u{102b8}\u{102b9}\u{102ba}X\u{102bb}\u{102bc}\u{102bd}\u{102be}\u{102bf}\u{102c0}\u{102c1}\u{102c2}\u{102c3}\u{102c4}\u{102c5}\u{102c6}\u{102c7}\u{102c8}\u{102c9}\u{102ca}\u{102cb}\u{102cc}\u{102cd}X\u{102ce}\u{102cf}\u{102d0}\u{102d1}\u{102d2}\u{102d3}\u{102d4}\u{102d5}\u{102d6}\u{102d7}\u{102d8}\u{102d9}\u{102da}\u{102db}\u{102dc}\u{102dd}\u{102de}\u{102df}\u{102e0}X\u{102e1}\u{102e2}\u{102e3}\u{102e4}\u{102e5}\u{102e6}\u{102e7}\u{102e8}\u{102e9}\u{102ea}\u{102eb}\u{102ec}\u{102ed}\u{102ee}\u{102ef}\u{102f0}\u{102f1}\u{102f2}\u{102f3}X\u{102f4}\u{102f5}\u{102f6}\u{102f7}\u{102f8}\u{102f9}\u{102fa}\u{102fb}\u{102fc}\u{102fd}\u{102fe}\u{102ff}\u{10300}\u{10301}\u{10302}\u{10303}\u{10304}\u{10305}\u{10306}X\u{10307}\u{10308}\u{10309}\u{1030a}\u{1030b}\u{1030c}\u{1030d}\u{1030e}\u{1030f}\u{10310}\u{10311}\u{10312}\u{10313}\u{10314}\u{10315}\u{10316}\u{10317}\u{10318}\u{10319}X\u{1031a}\u{1031b}\u{1031c}\u{1031d}\u{1031e}\u{1031f}\u{10320}\u{10321}\u{10322}\u{10323}\u{10324}\u{10325}\u{10326}\u{10327}\u{10328}\u{10329}\u{1032a}\u{1032b}\u{1032c}X\u{1032d}\u{1032e}\u{1032f}\u{10330}\u{10331}\u{10332}\u{10333}\u{10334}\u{10335}\u{10336}\u{10337}\u{10338}\u{10339}\u{1033a}\u{1033b}\u{1033c}\u{1033d}\u{1033e}\u{1033f}X\u{10340}\u{10341}\u{10342}\u{10343}\u{10344}\u{10345}\u{10346}\u{10347}\u{10348}\u{10349}\u{1034a}\u{1034b}\u{1034c}\u{1034d}\u{1034e}\u{1034f}\u{10350}\u{10351}\u{10352}X\u{10353}\u{10354}\u{10355}\u{10356}\u{10357}\u{10358}\u{10359}\u{1035a}\u{1035b}\u{1035c}\u{1035d}\u{1035e}\u{1035f}\u{10360}\u{10361}\u{10362}\u{10363}\u{10364}\u{10365}X\u{10366}\u{10367}\u{10368}\u{10369}\u{1036a}\u{1036b}\u{1036c}\u{1036d}\u{1036e}\u{1036f}\u{10370}\u{10371}\u{10372}\u{10373}\u{10374}\u{10375}\u{10376}\u{10377}\u{10378}X\u{10379}\u{1037a}\u{1037b}\u{1037c}\u{1037d}\u{1037e}\u{1037f}\u{10380}\u{10381}\u{10382}\u{10383}\u{10384}\u{10385}\u{10386}\u{10387}\u{10388}\u{10389}\u{1038a}\u{1038b}X\u{1038c}\u{1038d}\u{1038e}\u{1038f}\u{10390}\u{10391}\u{10392}\u{10393}\u{10394}\u{10395}\u{10396}\u{10397}\u{10398}\u{10399}\u{1039a}\u{1039b}\u{1039c}\u{1039d}\u{1039e}X\u{1039f}\u{103a0}\u{103a1}\u{103a2}\u{103a3}\u{103a4}\u{103a5}\u{103a6}\u{103a7}\u{103a8}\u{103a9}\u{103aa}\u{103ab}\u{103ac}\u{103ad}\u{103ae}\u{103af}\u{103b0}\u{103b1}X\u{103b2}\u{103b3}\u{103b4}\u{103b5}\u{103b6}\u{103b7}\u{103b8}\u{103b9}\u{103ba}\u{103bb}\u{103bc}\u{103bd}\u{103be}\u{103bf}\u{103c0}\u{103c1}\u{103c2}\u{103c3}\u{103c4}X\u{103c5}\u{103c6}\u{103c7}\u{103c8}\u{103c9}\u{103ca}\u{103cb}\u{103cc}\u{103cd}\u{103ce}\u{103cf}\u{103d0}\u{103d1}\u{103d2}\u{103d3}\u{103d4}\u{103d5}\u{103d6}\u{103d7}X\u{103d8}\u{103d9}',
'\u{10180}\u{10181}\u{10182}\u{10183}\u{10184}\u{10185}\u{10186}\u{10187}\u{10188}\u{10189}\u{1018a}X\u{1018b}\u{1018c}\u{1018d}\u{1018e}\u{1018f}\u{10190}\u{10191}\u{10192}\u{10193}\u{10194}\u{10195}\u{10196}\u{10197}\u{10198}\u{10199}\u{1019a}\u{1019b}\u{1019c}\u{1019d}X\u{1019e}\u{1019f}\u{101a0}\u{101a1}\u{101a2}\u{101a3}\u{101a4}\u{101a5}\u{101a6}\u{101a7}\u{101a8}\u{101a9}\u{101aa}\u{101ab}\u{101ac}\u{101ad}\u{101ae}\u{101af}\u{101b0}X\u{101b1}\u{101b2}\u{101b3}\u{101b4}\u{101b5}\u{101b6}\u{101b7}\u{101b8}\u{101b9}\u{101ba}\u{101bb}\u{101bc}\u{101bd}\u{101be}\u{101bf}\u{101c0}\u{101c1}\u{101c2}\u{101c3}X\u{101c4}\u{101c5}\u{101c6}\u{101c7}\u{101c8}\u{101c9}\u{101ca}\u{101cb}\u{101cc}\u{101cd}\u{101ce}\u{101cf}\u{101d0}\u{101d1}\u{101d2}\u{101d3}\u{101d4}\u{101d5}\u{101d6}X\u{101d7}\u{101d8}\u{101d9}\u{101da}\u{101db}\u{101dc}\u{101dd}\u{101de}\u{101df}\u{101e0}\u{101e1}\u{101e2}\u{101e3}\u{101e4}\u{101e5}\u{101e6}\u{101e7}\u{101e8}\u{101e9}X\u{101ea}\u{101eb}\u{101ec}\u{101ed}\u{101ee}\u{101ef}\u{101f0}\u{101f1}\u{101f2}\u{101f3}\u{101f4}\u{101f5}\u{101f6}\u{101f7}\u{101f8}\u{101f9}\u{101fa}\u{101fb}\u{101fc}X\u{101fd}\u{101fe}\u{101ff}\u{10200}\u{10201}\u{10202}\u{10203}\u{10204}\u{10205}\u{10206}\u{10207}\u{10208}\u{10209}\u{1020a}\u{1020b}\u{1020c}\u{1020d}\u{1020e}\u{1020f}X\u{10210}\u{10211}\u{10212}\u{10213}\u{10214}\u{10215}\u{10216}\u{10217}\u{10218}\u{10219}\u{1021a}\u{1021b}\u{1021c}\u{1021d}\u{1021e}\u{1021f}\u{10220}\u{10221}\u{10222}X\u{10223}\u{10224}\u{10225}\u{10226}\u{10227}\u{10228}\u{10229}\u{1022a}\u{1022b}\u{1022c}\u{1022d}\u{1022e}\u{1022f}\u{10230}\u{10231}\u{10232}\u{10233}\u{10234}\u{10235}X\u{10236}\u{10237}\u{10238}\u{10239}\u{1023a}\u{1023b}\u{1023c}\u{1023d}\u{1023e}\u{1023f}\u{10240}\u{10241}\u{10242}\u{10243}\u{10244}\u{10245}\u{10246}\u{10247}\u{10248}X\u{10249}\u{1024a}\u{1024b}\u{1024c}\u{1024d}\u{1024e}\u{1024f}\u{10250}\u{10251}\u{10252}\u{10253}\u{10254}\u{10255}\u{10256}\u{10257}\u{10258}\u{10259}\u{1025a}\u{1025b}X\u{1025c}\u{1025d}\u{1025e}\u{1025f}\u{10260}\u{10261}\u{10262}\u{10263}\u{10264}\u{10265}\u{10266}\u{10267}\u{10268}\u{10269}\u{1026a}\u{1026b}\u{1026c}\u{1026d}\u{1026e}X\u{1026f}\u{10270}\u{10271}\u{10272}\u{10273}\u{10274}\u{10275}\u{10276}\u{10277}\u{10278}\u{10279}\u{1027a}\u{1027b}\u{1027c}\u{1027d}\u{1027e}\u{1027f}\u{10280}\u{10281}X\u{10282}\u{10283}\u{10284}\u{10285}\u{10286}\u{10287}\u{10288}\u{10289}\u{1028a}\u{1028b}\u{1028c}\u{1028d}\u{1028e}\u{1028f}\u{10290}\u{10291}\u{10292}\u{10293}\u{10294}X\u{10295}\u{10296}\u{10297}\u{10298}\u{10299}\u{1029a}\u{1029b}\u{1029c}\u{1029d}\u{1029e}\u{1029f}\u{102a0}\u{102a1}\u{102a2}\u{102a3}\u{102a4}\u{102a5}\u{102a6}\u{102a7}X\u{102a8}\u{102a9}\u{102aa}\u{102ab}\u{102ac}',
'\u{10053}\u{10054}\u{10055}\u{10056}\u{10057}\u{10058}\u{10059}\u{1005a}X\u{1005b}\u{1005c}\u{1005d}\u{1005e}\u{1005f}\u{10060}\u{10061}\u{10062}\u{10063}\u{10064}\u{10065}\u{10066}\u{10067}\u{10068}\u{10069}\u{1006a}\u{1006b}\u{1006c}\u{1006d}X\u{1006e}\u{1006f}\u{10070}\u{10071}\u{10072}\u{10073}\u{10074}\u{10075}\u{10076}\u{10077}\u{10078}\u{10079}\u{1007a}\u{1007b}\u{1007c}\u{1007d}\u{1007e}\u{1007f}\u{10080}X\u{10081}\u{10082}\u{10083}\u{10084}\u{10085}\u{10086}\u{10087}\u{10088}\u{10089}\u{1008a}\u{1008b}\u{1008c}\u{1008d}\u{1008e}\u{1008f}\u{10090}\u{10091}\u{10092}\u{10093}X\u{10094}\u{10095}\u{10096}\u{10097}\u{10098}\u{10099}\u{1009a}\u{1009b}\u{1009c}\u{1009d}\u{1009e}\u{1009f}\u{100a0}\u{100a1}\u{100a2}\u{100a3}\u{100a4}\u{100a5}\u{100a6}X\u{100a7}\u{100a8}\u{100a9}\u{100aa}\u{100ab}\u{100ac}\u{100ad}\u{100ae}\u{100af}\u{100b0}\u{100b1}\u{100b2}\u{100b3}\u{100b4}\u{100b5}\u{100b6}\u{100b7}\u{100b8}\u{100b9}X\u{100ba}\u{100bb}\u{100bc}\u{100bd}\u{100be}\u{100bf}\u{100c0}\u{100c1}\u{100c2}\u{100c3}\u{100c4}\u{100c5}\u{100c6}\u{100c7}\u{100c8}\u{100c9}\u{100ca}\u{100cb}\u{100cc}X\u{100cd}\u{100ce}\u{100cf}\u{100d0}\u{100d1}\u{100d2}\u{100d3}\u{100d4}\u{100d5}\u{100d6}\u{100d7}\u{100d8}\u{100d9}\u{100da}\u{100db}\u{100dc}\u{100dd}\u{100de}\u{100df}X\u{100e0}\u{100e1}\u{100e2}\u{100e3}\u{100e4}\u{100e5}\u{100e6}\u{100e7}\u{100e8}\u{100e9}\u{100ea}\u{100eb}\u{100ec}\u{100ed}\u{100ee}\u{100ef}\u{100f0}\u{100f1}\u{100f2}X\u{100f3}\u{100f4}\u{100f5}\u{100f6}\u{100f7}\u{100f8}\u{100f9}\u{100fa}\u{100fb}\u{100fc}\u{100fd}\u{100fe}\u{100ff}\u{10100}\u{10101}\u{10102}\u{10103}\u{10104}\u{10105}X\u{10106}\u{10107}\u{10108}\u{10109}\u{1010a}\u{1010b}\u{1010c}\u{1010d}\u{1010e}\u{1010f}\u{10110}\u{10111}\u{10112}\u{10113}\u{10114}\u{10115}\u{10116}\u{10117}\u{10118}X\u{10119}\u{1011a}\u{1011b}\u{1011c}\u{1011d}\u{1011e}\u{1011f}\u{10120}\u{10121}\u{10122}\u{10123}\u{10124}\u{10125}\u{10126}\u{10127}\u{10128}\u{10129}\u{1012a}\u{1012b}X\u{1012c}\u{1012d}\u{1012e}\u{1012f}\u{10130}\u{10131}\u{10132}\u{10133}\u{10134}\u{10135}\u{10136}\u{10137}\u{10138}\u{10139}\u{1013a}\u{1013b}\u{1013c}\u{1013d}\u{1013e}X\u{1013f}\u{10140}\u{10141}\u{10142}\u{10143}\u{10144}\u{10145}\u{10146}\u{10147}\u{10148}\u{10149}\u{1014a}\u{1014b}\u{1014c}\u{1014d}\u{1014e}\u{1014f}\u{10150}\u{10151}X\u{10152}\u{10153}\u{10154}\u{10155}\u{10156}\u{10157}\u{10158}\u{10159}\u{1015a}\u{1015b}\u{1015c}\u{1015d}\u{1015e}\u{1015f}\u{10160}\u{10161}\u{10162}\u{10163}\u{10164}X\u{10165}\u{10166}\u{10167}\u{10168}\u{10169}\u{1016a}\u{1016b}\u{1016c}\u{1016d}\u{1016e}\u{1016f}\u{10170}\u{10171}\u{10172}\u{10173}\u{10174}\u{10175}\u{10176}\u{10177}X\u{10178}\u{10179}\u{1017a}\u{1017b}\u{1017c}\u{1017d}\u{1017e}\u{1017f}',
'\u{10000}\u{10001}\u{10002}\u{10003}\u{10004}\u{10005}\u{10006}\u{10007}\u{10008}\u{10009}\u{1000a}\u{1000b}\u{1000c}\u{1000d}\u{1000e}X\u{1000f}\u{10010}\u{10011}\u{10012}\u{10013}\u{10014}\u{10015}\u{10016}\u{10017}\u{10018}\u{10019}\u{1001a}\u{1001b}\u{1001c}\u{1001d}\u{1001e}\u{1001f}\u{10020}\u{10021}X\u{10022}\u{10023}\u{10024}\u{10025}\u{10026}\u{10027}\u{10028}\u{10029}\u{1002a}\u{1002b}\u{1002c}\u{1002d}\u{1002e}\u{1002f}\u{10030}\u{10031}\u{10032}\u{10033}\u{10034}X\u{10035}\u{10036}\u{10037}\u{10038}\u{10039}\u{1003a}\u{1003b}\u{1003c}\u{1003d}\u{1003e}\u{1003f}\u{10040}\u{10041}\u{10042}\u{10043}\u{10044}\u{10045}\u{10046}\u{10047}X\u{10048}\u{10049}\u{1004a}\u{1004b}\u{1004c}\u{1004d}\u{1004e}\u{1004f}\u{10050}\u{10051}\u{10052}'
'\u{10000}\u{10001}\u{10002}\u{10003}\u{10004}\u{10005}\u{10006}\u{10007}\u{10008}\u{10009}\u{1000a}\u{1000b}\u{1000c}\u{1000d}\u{1000e}X\u{1000f}\u{10010}\u{10011}\u{10012}\u{10013}\u{10014}\u{10015}\u{10016}\u{10017}\u{10018}\u{10019}\u{1001a}\u{1001b}\u{1001c}\u{1001d}\u{1001e}\u{1001f}\u{10020}\u{10021}X\u{10022}\u{10023}\u{10024}\u{10025}\u{10026}\u{10027}\u{10028}\u{10029}\u{1002a}\u{1002b}\u{1002c}\u{1002d}\u{1002e}\u{1002f}\u{10030}\u{10031}\u{10032}\u{10033}\u{10034}X\u{10035}\u{10036}\u{10037}\u{10038}\u{10039}\u{1003a}\u{1003b}\u{1003c}\u{1003d}\u{1003e}\u{1003f}\u{10040}\u{10041}\u{10042}\u{10043}\u{10044}\u{10045}\u{10046}\u{10047}X\u{10048}\u{10049}\u{1004a}\u{1004b}\u{1004c}\u{1004d}\u{1004e}\u{1004f}\u{10050}\u{10051}\u{10052}',
];
+7 -7
View File
@@ -15,12 +15,12 @@ void main() {
typedef FieldValidator<T> = List<String> Function(T? value);
typedef Validator<T> = bool Function(T? value);
FieldValidator<T> createValidator<T>(
List<({Validator<T> validate, String message})> validators) =>
(T? value) {
return validators
.where((validator) => !validator.validate(value))
.map((validator) => validator.message)
.toList();
};
List<({Validator<T> validate, String message})> validators,
) => (T? value) {
return validators
.where((validator) => !validator.validate(value))
.map((validator) => validator.message)
.toList();
};
bool isNotEmpty(String? value) => value != null && value.isNotEmpty;
+4 -4
View File
@@ -18,10 +18,10 @@ class Foo extends Bar {
final Map<int, int> foo1 = {for (final (int x,) in records) x: x};
final Map<int, int> foo2;
Foo()
// Constructor field initializer
: foo2 = {for (final (int x,) in records) x: x},
// Super initializer
super({for (final (int x,) in records) x: x});
// Constructor field initializer
: foo2 = {for (final (int x,) in records) x: x},
// Super initializer
super({for (final (int x,) in records) x: x});
}
void main() {
+18 -12
View File
@@ -29,29 +29,35 @@ void main() {
// !! If I change parameters to `Iterable<T1> it1, Iterable<T2> it2` and
// create `(it1, it2)` in this function, it avoids the error.
Iterable<(T1, T2)> zip2<T1, T2>((Iterable<T1>, Iterable<T2>) its) =>
_ComputedIterable<(Iterable<T1>, Iterable<T2>),
(Iterator<T1>, Iterator<T2>)>(_IterationStrategy2<T1, T2>(), its);
_ComputedIterable<
(Iterable<T1>, Iterable<T2>),
(Iterator<T1>, Iterator<T2>)
>(_IterationStrategy2<T1, T2>(), its);
Iterable<(T1, T2, T3)> zip3<T1, T2, T3>(
(Iterable<T1>, Iterable<T2>, Iterable<T3>) its) =>
_ComputedIterable(_IterationStrategy3<T1, T2, T3>(), its);
(Iterable<T1>, Iterable<T2>, Iterable<T3>) its,
) => _ComputedIterable(_IterationStrategy3<T1, T2, T3>(), its);
class _IterationStrategy2<T1, T2>
implements
_IterationStrategy<(Iterable<T1>, Iterable<T2>),
(Iterator<T1>, Iterator<T2>)> {
_IterationStrategy<
(Iterable<T1>, Iterable<T2>),
(Iterator<T1>, Iterator<T2>)
> {
(Iterator<T1>, Iterator<T2>) iterator(
(Iterable<T1>, Iterable<T2>) iterables) =>
(iterables.$1.iterator, iterables.$2.iterator);
(Iterable<T1>, Iterable<T2>) iterables,
) => (iterables.$1.iterator, iterables.$2.iterator);
}
class _IterationStrategy3<T1, T2, T3>
implements
_IterationStrategy<(Iterable<T1>, Iterable<T2>, Iterable<T3>),
(Iterator<T1>, Iterator<T2>, Iterator<T3>)> {
_IterationStrategy<
(Iterable<T1>, Iterable<T2>, Iterable<T3>),
(Iterator<T1>, Iterator<T2>, Iterator<T3>)
> {
(Iterator<T1>, Iterator<T2>, Iterator<T3>) iterator(
(Iterable<T1>, Iterable<T2>, Iterable<T3>) iterables) =>
(iterables.$1.iterator, iterables.$2.iterator, iterables.$3.iterator);
(Iterable<T1>, Iterable<T2>, Iterable<T3>) iterables,
) => (iterables.$1.iterator, iterables.$2.iterator, iterables.$3.iterator);
}
class _ComputedIterable<S, I extends Object> extends Iterable<Never> {
+3 -1
View File
@@ -11,7 +11,9 @@ abstract class _DoubleLinkedQueueEntry<E> {
_DoubleLinkedQueueEntry<E>? _nextLink;
void _link(
_DoubleLinkedQueueEntry<E>? previous, _DoubleLinkedQueueEntry<E>? next) {
_DoubleLinkedQueueEntry<E>? previous,
_DoubleLinkedQueueEntry<E>? next,
) {
_nextLink = next;
_previousLink = previous;
previous?._nextLink = this;
+3 -1
View File
@@ -11,7 +11,9 @@ class DoubleLinkedQueueEntry<E> {
DoubleLinkedQueueEntry(this.element);
void _link(
DoubleLinkedQueueEntry<E>? previous, DoubleLinkedQueueEntry<E>? next) {
DoubleLinkedQueueEntry<E>? previous,
DoubleLinkedQueueEntry<E>? next,
) {
_nextLink = next;
_previousLink = previous;
previous?._nextLink = this;
+2 -1
View File
@@ -67,7 +67,8 @@ const int NI7 = -PI7;
/// Ensures that the behaviour of `action()` is the same as `value.round()`.
@pragma(
'dart2js:noInline') // To ensure 'value.round()' has a non-constant receiver.
'dart2js:noInline',
) // To ensure 'value.round()' has a non-constant receiver.
check(value, action) {
var result1, result2;
try {
+11 -6
View File
@@ -22,12 +22,17 @@ void main() {
Expect.equals('C<num>', new C<num>().runtimeType.toString());
Expect.equals('C<bool>', new C<bool>().runtimeType.toString());
Expect.equals('D<dynamic, dynamic, dynamic>', new D().runtimeType.toString());
Expect.equals('D<dynamic, int, dynamic>',
new D<dynamic, int, dynamic>().runtimeType.toString());
Expect.equals(
'D<dynamic, int, dynamic>',
new D<dynamic, int, dynamic>().runtimeType.toString(),
);
D d = new D<dynamic, D, D<dynamic, dynamic, int>>();
Expect.equals(
'D<dynamic, D<dynamic, dynamic, dynamic>, D<dynamic, dynamic, int>>',
d.runtimeType.toString());
Expect.equals(r'C<Class$With$Dollar>',
new C<Class$With$Dollar>().runtimeType.toString());
'D<dynamic, D<dynamic, dynamic, dynamic>, D<dynamic, dynamic, int>>',
d.runtimeType.toString(),
);
Expect.equals(
r'C<Class$With$Dollar>',
new C<Class$With$Dollar>().runtimeType.toString(),
);
}
+9 -6
View File
@@ -7,7 +7,7 @@ import "package:expect/expect.dart";
// Test that string escapes work correctly.
testSingleCharacterEscapes() {
List/*<String>*/ examples = [
List /*<String>*/ examples = [
"\b\f\n\r\t\v",
'\b\f\n\r\t\v',
"""\b\f\n\r\t\v""",
@@ -63,9 +63,9 @@ testUEscapes() {
"""\u0000\u0001\u0022\u0027\u005c\u007f\u0080\u00ff"""
"""\u0100\u1000\ud7ff\ue000\uffff""",
'''\u0000\u0001\u0022\u0027\u005c\u007f\u0080\u00ff'''
'''\u0100\u1000\ud7ff\ue000\uffff'''
'''\u0100\u1000\ud7ff\ue000\uffff''',
];
List/*<int>*/ values = [
List /*<int>*/ values = [
0,
1,
0x22,
@@ -78,7 +78,7 @@ testUEscapes() {
0x1000,
0xd7ff,
0xe000,
0xffff
0xffff,
];
for (String s in examples) {
Expect.equals(values.length, s.length);
@@ -87,7 +87,8 @@ testUEscapes() {
}
}
// No characters above 0xffff until Leg supports that.
var long = "\u{0}\u{00}\u{000}\u{0000}\u{00000}\u{000000}"
var long =
"\u{0}\u{00}\u{000}\u{0000}\u{00000}\u{000000}"
"\u{1}\u{01}\u{001}\u{00001}"
"\u{ffff}\u{0ffff}\u{00ffff}";
var longValues = [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0xffff, 0xffff, 0xffff];
@@ -117,7 +118,9 @@ testIdentityEscapes() {
testQuotes() {
// The string [ "' ].
String bothQuotes = ' "' "' ";
String bothQuotes =
' "'
"' ";
Expect.equals(bothQuotes, " \"' ");
Expect.equals(bothQuotes, ' "\' ');
Expect.equals(bothQuotes, """ "' """);
@@ -57,18 +57,13 @@ void testMultiLine() {
// Newlines at beginning of multiline strings are not included, but only
// if they are in the source.
Expect.equals(
"\n",
"""${''}
Expect.equals("\n", """${''}
""");
Expect.equals("\n", """${''} """);
Expect.equals(
"\n",
"""${''}
Expect.equals("\n", """${''}
""");
Expect.equals(
"x",
"""
Expect.equals("\n", """${''}
""");
Expect.equals("x", """
x""");
Expect.equals("\n", """${'\n'}""");
Expect.equals("\r", """${'\r'}""");
@@ -97,15 +92,25 @@ void testSimple() {
// Function calls as expressions.
Expect.equals(
"sfun372.71828truenull", "${sfun()}${ifun()}${dfun()}${bfun()}${nfun()}");
"sfun372.71828truenull",
"${sfun()}${ifun()}${dfun()}${bfun()}${nfun()}",
);
Expect.equals(
"nullsfun372.71828true", "${nfun()}${sfun()}${ifun()}${dfun()}${bfun()}");
"nullsfun372.71828true",
"${nfun()}${sfun()}${ifun()}${dfun()}${bfun()}",
);
Expect.equals(
"truenullsfun372.71828", "${bfun()}${nfun()}${sfun()}${ifun()}${dfun()}");
"truenullsfun372.71828",
"${bfun()}${nfun()}${sfun()}${ifun()}${dfun()}",
);
Expect.equals(
"2.71828truenullsfun37", "${dfun()}${bfun()}${nfun()}${sfun()}${ifun()}");
"2.71828truenullsfun37",
"${dfun()}${bfun()}${nfun()}${sfun()}${ifun()}",
);
Expect.equals(
"372.71828truenullsfun", "${ifun()}${dfun()}${bfun()}${nfun()}${sfun()}");
"372.71828truenullsfun",
"${ifun()}${dfun()}${bfun()}${nfun()}${sfun()}",
);
// String contents around interpolated parts.
Expect.equals("stringstring", "$a$a");
+19 -12
View File
@@ -52,14 +52,11 @@ void testMultiLine() {
// Newlines at beginning of multiline strings are not included, but only
// if they are in the source.
Expect.equals(
"\n",
"""${''}
Expect.equals("\n", """${''}
""");
Expect.equals("\n", """${''} """);
Expect.equals(
"\n",
"""${''}
Expect.equals("\n", """${''}
""");
Expect.equals("\n", """${''}
""");
Expect.equals("\n", """${'\n'}""");
Expect.equals("\r", """${'\r'}""");
@@ -88,15 +85,25 @@ void testSimple() {
// Function calls as expressions.
Expect.equals(
"sfun372.71828truenull", "${sfun()}${ifun()}${dfun()}${bfun()}${nfun()}");
"sfun372.71828truenull",
"${sfun()}${ifun()}${dfun()}${bfun()}${nfun()}",
);
Expect.equals(
"nullsfun372.71828true", "${nfun()}${sfun()}${ifun()}${dfun()}${bfun()}");
"nullsfun372.71828true",
"${nfun()}${sfun()}${ifun()}${dfun()}${bfun()}",
);
Expect.equals(
"truenullsfun372.71828", "${bfun()}${nfun()}${sfun()}${ifun()}${dfun()}");
"truenullsfun372.71828",
"${bfun()}${nfun()}${sfun()}${ifun()}${dfun()}",
);
Expect.equals(
"2.71828truenullsfun37", "${dfun()}${bfun()}${nfun()}${sfun()}${ifun()}");
"2.71828truenullsfun37",
"${dfun()}${bfun()}${nfun()}${sfun()}${ifun()}",
);
Expect.equals(
"372.71828truenullsfun", "${ifun()}${dfun()}${bfun()}${nfun()}${sfun()}");
"372.71828truenullsfun",
"${ifun()}${dfun()}${bfun()}${nfun()}${sfun()}",
);
// String contents around interpolated parts.
Expect.equals("stringstring", "$a$a");
+2 -6
View File
@@ -15,18 +15,14 @@ class A {
class B extends A {
int y;
B(i)
: y = i++,
super(i + 5) {
B(i) : y = i++, super(i + 5) {
message = '${message}B($i)';
}
}
class C extends B {
var z;
C(i)
: z = i,
super(i * 3) {
C(i) : z = i, super(i * 3) {
message = '${message}C($i)';
}
}
+1 -1
View File
@@ -21,4 +21,4 @@ class Class extends SuperB with Mixin {}
main() {
var c = new Class();
Expect.equals("BMC", c.method('C'));
}
}
+1 -1
View File
@@ -21,4 +21,4 @@ class Class extends SuperB with Mixin {}
main() {
var c = new Class();
Expect.equals("BMC", c.method('C'));
}
}
+1 -2
View File
@@ -20,8 +20,7 @@ class SuperB3<T> {}
class InterfaceB<T> {}
mixin MixinB<T>
on SuperB1<List<T>>, SuperB2<int>, SuperB3<T>
mixin MixinB<T> on SuperB1<List<T>>, SuperB2<int>, SuperB3<T>
implements InterfaceB<Map<int, T>> {}
class C extends SuperA1 with SuperA2 {}
+1 -3
View File
@@ -11,9 +11,7 @@ class A extends Object {}
class Concater {
final x;
final y;
Concater(x, y)
: this.x = x,
this.y = y;
Concater(x, y) : this.x = x, this.y = y;
add() => x + y.toString();
}
+83 -38
View File
@@ -21,10 +21,13 @@ void find1(expected, thunk) {
}
if (exceptionText == null) {
Expect.fail(
'Expected exception containing "$expected", returned: $returned');
'Expected exception containing "$expected", returned: $returned',
);
}
Expect.isTrue(exceptionText.contains(expected),
'Expected "$expected" in "$exceptionText"');
Expect.isTrue(
exceptionText.contains(expected),
'Expected "$expected" in "$exceptionText"',
);
}
void find(expected, [thunk1, thunk2, thunk3, thunk4]) {
@@ -38,55 +41,97 @@ main() {
var NaN = double.nan;
var Infinity = double.infinity;
find(' Infinity: 123 ~/ 0', () => confuse(123) ~/ confuse(0),
() => confuse(123) ~/ 0, () => 123 ~/ confuse(0), () => 123 ~/ 0);
find(
' Infinity: 123 ~/ 0',
() => confuse(123) ~/ confuse(0),
() => confuse(123) ~/ 0,
() => 123 ~/ confuse(0),
() => 123 ~/ 0,
);
find(
'-Infinity: 123 ~/ -0.0',
() => confuse(123) ~/ confuse(-0.0),
() => confuse(123) ~/ -0.0,
() => 123 ~/ confuse(-0.0),
() => 123 ~/ -0.0);
find(' NaN: NaN ~/ 123', () => confuse(NaN) ~/ confuse(123),
() => confuse(NaN) ~/ 123, () => NaN ~/ confuse(123), () => NaN ~/ 123);
'-Infinity: 123 ~/ -0.0',
() => confuse(123) ~/ confuse(-0.0),
() => confuse(123) ~/ -0.0,
() => 123 ~/ confuse(-0.0),
() => 123 ~/ -0.0,
);
find(
' Infinity: 1e+200 ~/ 1e-200',
() => confuse(1e200) ~/ confuse(1e-200),
() => confuse(1e200) ~/ 1e-200,
() => 1e200 ~/ confuse(1e-200),
() => 1e200 ~/ 1e-200);
' NaN: NaN ~/ 123',
() => confuse(NaN) ~/ confuse(123),
() => confuse(NaN) ~/ 123,
() => NaN ~/ confuse(123),
() => NaN ~/ 123,
);
find(
' Infinity: 1e+200 ~/ 1e-200',
() => confuse(1e200) ~/ confuse(1e-200),
() => confuse(1e200) ~/ 1e-200,
() => 1e200 ~/ confuse(1e-200),
() => 1e200 ~/ 1e-200,
);
find('NaN.toInt()', () => confuse(NaN).toInt(), () => NaN.toInt());
find(' Infinity.toInt()', () => confuse(Infinity).toInt(),
() => Infinity.toInt());
find('-Infinity.toInt()', () => confuse(-Infinity).toInt(),
() => (-Infinity).toInt());
find(
' Infinity.toInt()',
() => confuse(Infinity).toInt(),
() => Infinity.toInt(),
);
find(
'-Infinity.toInt()',
() => confuse(-Infinity).toInt(),
() => (-Infinity).toInt(),
);
find('NaN.ceil()', () => confuse(NaN).ceil(), () => NaN.ceil());
find(' Infinity.ceil()', () => confuse(Infinity).ceil(),
() => Infinity.ceil());
find('-Infinity.ceil()', () => confuse(-Infinity).ceil(),
() => (-Infinity).ceil());
find(
' Infinity.ceil()',
() => confuse(Infinity).ceil(),
() => Infinity.ceil(),
);
find(
'-Infinity.ceil()',
() => confuse(-Infinity).ceil(),
() => (-Infinity).ceil(),
);
find('NaN.floor()', () => confuse(NaN).floor(), () => NaN.floor());
find(' Infinity.floor()', () => confuse(Infinity).floor(),
() => Infinity.floor());
find('-Infinity.floor()', () => confuse(-Infinity).floor(),
() => (-Infinity).floor());
find(
' Infinity.floor()',
() => confuse(Infinity).floor(),
() => Infinity.floor(),
);
find(
'-Infinity.floor()',
() => confuse(-Infinity).floor(),
() => (-Infinity).floor(),
);
find('NaN.round()', () => confuse(NaN).round(), () => NaN.round());
find(' Infinity.round()', () => confuse(Infinity).round(),
() => Infinity.round());
find('-Infinity.round()', () => confuse(-Infinity).round(),
() => (-Infinity).round());
find(
' Infinity.round()',
() => confuse(Infinity).round(),
() => Infinity.round(),
);
find(
'-Infinity.round()',
() => confuse(-Infinity).round(),
() => (-Infinity).round(),
);
// `truncate()` is the same as `toInt()`.
// We could change the runtime so that `truncate` is reported.
find('NaN.toInt()', () => confuse(NaN).truncate(), () => NaN.truncate());
find(' Infinity.toInt()', () => confuse(Infinity).truncate(),
() => Infinity.truncate());
find('-Infinity.toInt()', () => confuse(-Infinity).truncate(),
() => (-Infinity).truncate());
find(
' Infinity.toInt()',
() => confuse(Infinity).truncate(),
() => Infinity.truncate(),
);
find(
'-Infinity.toInt()',
() => confuse(-Infinity).truncate(),
() => (-Infinity).truncate(),
);
}

Some files were not shown because too many files have changed in this diff Show More