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

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

Issue 2579253003: Add one more test for configurable imports. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « tests/language/config_import_corelib_io.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « tests/language/config_import_corelib_io.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698