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

Side by Side Diff: tests/language/redirecting_factory_default_values_test.dart

Issue 2765893003: Fix warnings_checker.dart handling of multitests (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Test that parameter default values are disallowed in a redirecting factory. 5 // Test that parameter default values are disallowed in a redirecting factory.
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 class A { 9 class A {
10 A(this.a, [this.b = 0]); 10 A(this.a, [this.b = 0]);
11 factory A.f(a) = A; 11 factory A.f(a) = A;
12 factory A.g(a, [b = 0]) = A; // /// 01: compile-time error 12 factory A.g(a, [b = 0]) = A; // //# 01: compile-time error
13 factory A.h(a, {b: 0}) = A; // /// 02: compile-time error 13 factory A.h(a, {b: 0}) = A; // //# 02: compile-time error
14 14
15 int a; 15 int a;
16 int b; 16 int b;
17 } 17 }
18 18
19 main() { 19 main() {
20 var x = new A.f(42); 20 var x = new A.f(42);
21 Expect.equals(x.a, 42); 21 Expect.equals(x.a, 42);
22 Expect.equals(x.b, 0); 22 Expect.equals(x.b, 0);
23 23
24 var y = new A.f(42, 43); 24 var y = new A.f(42, 43);
25 Expect.equals(y.a, 42); 25 Expect.equals(y.a, 42);
26 Expect.equals(y.b, 43); 26 Expect.equals(y.b, 43);
27 } 27 }
OLDNEW
« no previous file with comments | « tests/language/proxy3_test.dart ('k') | tests/language/redirecting_factory_infinite_steps_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698