dart-sdk/tests/language_2/library/prefixes.dart
Robert Nystrom fc1b1ecc71 Move files under language_2 into subdirectories.
Change-Id: Idbcc965a27e9ffeedf5e0a1068b019de4193070f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127745
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-12-11 19:18:00 +00:00

75 lines
2 KiB
Dart

// Copyright (c) 2011, 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.
library LibraryPrefixes.lib;
import "prefixes_test1.dart";
import "prefixes_test2.dart" as other;
class LibraryPrefixes {
static void main(var expectEquals) {
var a = Constants.PI;
var b = other.Constants.PI;
expectEquals(3.14, a);
expectEquals(3.14, b);
expectEquals(1, Constants.foo);
expectEquals(2, other.Constants.foo);
expectEquals(-1, A.y);
expectEquals(0, other.A.y);
expectEquals(1, new A().x);
expectEquals(2, new other.A().x);
expectEquals(3, new A.named().x);
expectEquals(4, new other.A.named().x);
expectEquals(3, new A.fac().x);
expectEquals(4, new other.A.fac().x);
expectEquals(1, new B().x);
expectEquals(2, new other.B().x);
expectEquals(8, new B.named().x);
expectEquals(13, new other.B.named().x);
expectEquals(8, new B.fac().x);
expectEquals(13, new other.B.fac().x);
expectEquals(1, const C().x);
expectEquals(2, const other.C().x);
expectEquals(3, const C.named().x);
expectEquals(4, const other.C.named().x);
expectEquals(3, new C.fac().x);
expectEquals(4, new other.C.fac().x);
expectEquals(1, const D().x);
expectEquals(2, const other.D().x);
expectEquals(8, const D.named().x);
expectEquals(13, const other.D.named().x);
expectEquals(8, new D.fac().x);
expectEquals(13, new other.D.fac().x);
expectEquals(0, E.foo());
expectEquals(3, other.E.foo());
expectEquals(1, new E().bar());
expectEquals(4, new other.E().bar());
expectEquals(9, new E().toto(7)());
expectEquals(16, new other.E().toto(11)());
expectEquals(111, (new E.fun(100).f)());
expectEquals(1313, (new other.E.fun(1300).f)());
expectEquals(999, E.fooo(900)());
expectEquals(2048, other.E.fooo(1024)());
}
}