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

Unified Diff: tests/language/src/Private1.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/src/PrefixTest2.dart ('k') | tests/language/src/Private2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/Private1.dart
diff --git a/tests/language/src/Private1.dart b/tests/language/src/Private1.dart
deleted file mode 100644
index 6841cda70451e285a42b4dfacb5508806917210c..0000000000000000000000000000000000000000
--- a/tests/language/src/Private1.dart
+++ /dev/null
@@ -1,90 +0,0 @@
-// 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.
-
-// Dart test for testing access to private fields.
-
-main() {
- testPrivateTopLevel();
- testPrivateClasses();
-}
-
-void expectCatch(f) {
- bool threw = false;
- try {
- f();
- } catch (var e) {
- threw = true;
- }
- Expect.equals(true, threw);
-}
-
-String _private1() => "private1";
-final String _private1Field = "private1Field";
-
-void testPrivateTopLevel() {
- Expect.equals("private1", _private1());
- Expect.equals("private2", _private2());
- Expect.equals("private1Field", _private1Field);
- Expect.equals("private2Field", _private2Field);
-}
-
-class _A {
- _A() : fieldA = 499;
-
- int fieldA;
-}
-
-class AExposed extends _A {
- AExposed() : super();
-}
-
-class B {
- int _fieldB;
- B() : _fieldB = 42;
-}
-
-class C1 {
- int _field1;
- C1() : _field1 = 499;
-
- field1a() => _field1;
-}
-
-class C3 extends C2 {
- int _field2;
- C3() : super(), _field2 = 42;
-
- field2a() => _field2;
- field1c() => _field1;
-}
-
-int c_field1a(c) => c._field1;
-int c_field2a(c) => c._field2;
-
-void testPrivateClasses() {
- _A a = new _A();
- Expect.equals(499, a.fieldA);
- Expect.equals(499, accessFieldA2(a));
- Expect.equals(499, LibOther3.accessFieldA3(a));
-
- var a2 = new AImported();
- Expect.equals(499, a2.getFieldA());
-
- B b = new B();
- Expect.equals(42, b._fieldB);
- Expect.equals(42, accessFieldB2(b));
- expectCatch(() => LibOther3.accessFieldB3(b));
-
- C4 c = new C4();
- Expect.equals(499, c_field1a(c));
- Expect.equals(499, c.field1a());
- Expect.equals(42, c_field2a(c));
- Expect.equals(42, c.field2a());
- Expect.equals(99, LibOther3.c_field1b(c));
- Expect.equals(99, c.field1b());
- Expect.equals(1024, LibOther3.c_field2b(c));
- Expect.equals(1024, c.field2b());
- Expect.equals(499, c.field1c());
- Expect.equals(99, c.field1d());
-}
« no previous file with comments | « tests/language/src/PrefixTest2.dart ('k') | tests/language/src/Private2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698