OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 import 'package:expect/expect.dart'; |
| 6 |
| 7 import 'config_import_corelib_general.dart' |
| 8 if (dart.library.io) 'config_import_corelib_io.dart' |
| 9 if (dart.library.http) 'config_import_corelib_http.dart' |
| 10 as lib; |
| 11 |
| 12 class SubClassy extends lib.Classy { |
| 13 String get superName => super.name; |
| 14 } |
| 15 |
| 16 main() { |
| 17 var io = const bool.fromEnvironment("dart.library.io"); |
| 18 var http = const bool.fromEnvironment("dart.library.http"); |
| 19 |
| 20 var cy = new SubClassy(); |
| 21 |
| 22 if (io) { |
| 23 Expect.isTrue(lib.general()); |
| 24 Expect.equals("io", lib.name); |
| 25 Expect.equals("classy io", cy.name); |
| 26 |
| 27 Expect.isTrue(lib.ioSpecific()); |
| 28 Expect.equals("classy io", cy.ioSpecific()); |
| 29 |
| 30 Expect.throws(() { lib.httpSpecific(); }); |
| 31 Expect.throws(() { cy.httpSpecific(); }); |
| 32 } else if (http) { |
| 33 Expect.isTrue(lib.general()); |
| 34 Expect.equals("http", lib.name); |
| 35 Expect.equals("classy http", cy.name); |
| 36 |
| 37 Expect.throws(() { lib.ioSpecific(); }); |
| 38 Expect.throws(() { cy.ioSpecific(); }); |
| 39 |
| 40 Expect.isTrue(lib.httpSpecific()); |
| 41 Expect.equals("classy http", cy.httpSpecific()); |
| 42 } else { |
| 43 Expect.isTrue(lib.general()); |
| 44 Expect.equals("general", lib.name); |
| 45 Expect.equals("classy general", cy.name); |
| 46 |
| 47 Expect.throws(() { lib.ioSpecific(); }); |
| 48 Expect.throws(() { cy.ioSpecific(); }); |
| 49 |
| 50 Expect.throws(() { lib.httpSpecific(); }); |
| 51 Expect.throws(() { cy.httpSpecific(); }); |
| 52 } |
| 53 } |
OLD | NEW |