mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:27:17 +00:00
d35702e83a
Change-Id: I95d0545c17bd0755424c50f3c5c5f8b89b8c01de Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148944 Reviewed-by: Erik Ernst <eernst@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com>
53 lines
1.5 KiB
Dart
53 lines
1.5 KiB
Dart
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
|
// 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 'config_corelib_general.dart'
|
|
if (dart.library.io) 'config_corelib_io.dart'
|
|
if (dart.library.http) 'config_corelib_http.dart' as lib;
|
|
|
|
class SubClassy extends lib.Classy {
|
|
String get superName => super.name;
|
|
}
|
|
|
|
main() {
|
|
var io = const bool.fromEnvironment("dart.library.io");
|
|
var http = const bool.fromEnvironment("dart.library.http");
|
|
|
|
var cy = new SubClassy();
|
|
|
|
if (io) {
|
|
Expect.isTrue(lib.general());
|
|
Expect.equals("io", lib.name);
|
|
Expect.equals("classy io", cy.name);
|
|
|
|
Expect.isTrue(lib.ioSpecific());
|
|
Expect.equals("classy io", cy.ioSpecific());
|
|
|
|
Expect.isFalse(lib.httpSpecific());
|
|
Expect.throws(cy.httpSpecific);
|
|
} else if (http) {
|
|
Expect.isTrue(lib.general());
|
|
Expect.equals("http", lib.name);
|
|
Expect.equals("classy http", cy.name);
|
|
|
|
Expect.isFalse(lib.ioSpecific());
|
|
Expect.throws(cy.ioSpecific);
|
|
|
|
Expect.isTrue(lib.httpSpecific());
|
|
Expect.equals("classy http", cy.httpSpecific());
|
|
} else {
|
|
Expect.isTrue(lib.general());
|
|
Expect.equals("general", lib.name);
|
|
Expect.equals("classy general", cy.name);
|
|
|
|
Expect.isFalse(lib.ioSpecific());
|
|
Expect.throws(cy.ioSpecific);
|
|
|
|
Expect.isFalse(lib.httpSpecific());
|
|
Expect.throws(cy.httpSpecific);
|
|
}
|
|
}
|