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

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

Issue 2768073002: Format all 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 // Dart test program for testing default factories. 7 // Dart test program for testing default factories.
8 8
9 abstract class Vehicle { 9 abstract class Vehicle {
10 factory Vehicle() = GoogleOne.Vehicle; //# 01: static type warning 10 factory Vehicle() = GoogleOne.Vehicle; //# 01: static type warning
11 } 11 }
12 12
13
14 class Bike implements Vehicle, GoogleOne { 13 class Bike implements Vehicle, GoogleOne {
15 Bike.redOne() {} 14 Bike.redOne() {}
16 } 15 }
17 16
18
19 abstract class SpaceShip { 17 abstract class SpaceShip {
20 factory SpaceShip() = GoogleOne; 18 factory SpaceShip() = GoogleOne;
21 } 19 }
22 20
23
24 class GoogleOne implements SpaceShip { 21 class GoogleOne implements SpaceShip {
25 GoogleOne.internal_() {} 22 GoogleOne.internal_() {}
26 factory GoogleOne() { return new GoogleOne.internal_(); } 23 factory GoogleOne() {
27 factory GoogleOne.Vehicle() { return new Bike.redOne(); } 24 return new GoogleOne.internal_();
25 }
26 factory GoogleOne.Vehicle() {
27 return new Bike.redOne();
28 }
28 } 29 }
29 30
30
31 main() { 31 main() {
32 Expect.equals(true, (new Bike.redOne()) is Bike); 32 Expect.equals(true, (new Bike.redOne()) is Bike);
33 Expect.equals(true, (new SpaceShip()) is GoogleOne); 33 Expect.equals(true, (new SpaceShip()) is GoogleOne);
34 Expect.equals(true, (new Vehicle()) is Bike); //# 01: continued 34 Expect.equals(true, (new Vehicle()) is Bike); //# 01: continued
35 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698