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

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

Issue 10837359: Language tests updated to use const instead of final. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/prefix_test2.dart ('k') | tests/language/private2.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Dart test for testing access to private fields. 5 // Dart test for testing access to private fields.
6 6
7 main() { 7 main() {
8 testPrivateTopLevel(); 8 testPrivateTopLevel();
9 testPrivateClasses(); 9 testPrivateClasses();
10 } 10 }
11 11
12 void expectCatch(f) { 12 void expectCatch(f) {
13 bool threw = false; 13 bool threw = false;
14 try { 14 try {
15 f(); 15 f();
16 } catch (var e) { 16 } catch (var e) {
17 threw = true; 17 threw = true;
18 } 18 }
19 Expect.equals(true, threw); 19 Expect.equals(true, threw);
20 } 20 }
21 21
22 String _private1() => "private1"; 22 String _private1() => "private1";
23 final String _private1Field = "private1Field"; 23 const String _private1Field = "private1Field";
24 24
25 void testPrivateTopLevel() { 25 void testPrivateTopLevel() {
26 Expect.equals("private1", _private1()); 26 Expect.equals("private1", _private1());
27 Expect.equals("private2", _private2()); 27 Expect.equals("private2", _private2());
28 Expect.equals("private1Field", _private1Field); 28 Expect.equals("private1Field", _private1Field);
29 Expect.equals("private2Field", _private2Field); 29 Expect.equals("private2Field", _private2Field);
30 } 30 }
31 31
32 class _A { 32 class _A {
33 _A() : fieldA = 499; 33 _A() : fieldA = 499;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 Expect.equals(42, c.field2a()); 88 Expect.equals(42, c.field2a());
89 Expect.equals(99, LibOther3.c_field1b(c)); 89 Expect.equals(99, LibOther3.c_field1b(c));
90 Expect.equals(99, c.field1b()); 90 Expect.equals(99, c.field1b());
91 Expect.equals(1024, LibOther3.c_field2b(c)); 91 Expect.equals(1024, LibOther3.c_field2b(c));
92 Expect.equals(1024, c.field2b()); 92 Expect.equals(1024, c.field2b());
93 Expect.equals(499, c.field1c()); 93 Expect.equals(499, c.field1c());
94 Expect.equals(99, c.field1d()); 94 Expect.equals(99, c.field1d());
95 Expect.equals(499, _field1FromNewC4()); 95 Expect.equals(499, _field1FromNewC4());
96 Expect.equals(42, _field2FromNewC4()); 96 Expect.equals(42, _field2FromNewC4());
97 } 97 }
OLDNEW
« no previous file with comments | « tests/language/prefix_test2.dart ('k') | tests/language/private2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698