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

Side by Side Diff: tests/language/src/Setter0Test.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/src/SecondTest.dart ('k') | tests/language/src/Setter1Test.dart » ('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) 2011, 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 // Dart test program for testing setting/getting of fields when
5 // only getter/setter methods are specified.
6
7 class First {
8 First(int val) : a_ = val { }
9 int a_;
10 }
11
12 class Second extends First {
13 static int c;
14
15 Second(int val) : super(val) { }
16
17 static void testStaticMethod() {
18 int i;
19 Second.static_a = 20;
20 i = Second.c;
21 }
22
23 void set instance_a(int value) {
24 a_ = a_ + value;
25 }
26 int get instance_a() {
27 return a_;
28 }
29
30 static void set static_a(int value) {
31 Second.c = value;
32 }
33
34 static int get static_d() {
35 return Second.c;
36 }
37 }
38
39 class Setter0Test {
40 static testMain() {
41 Second obj = new Second(10);
42 Expect.equals(10, obj.instance_a);
43 obj.instance_a = 20;
44 Expect.equals(30, obj.instance_a);
45
46 Second.testStaticMethod();
47 Expect.equals(20, Second.c);
48 Expect.equals(20, Second.static_d);
49 }
50 }
51
52
53 main() {
54 Setter0Test.testMain();
55 }
OLDNEW
« no previous file with comments | « tests/language/src/SecondTest.dart ('k') | tests/language/src/Setter1Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698