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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 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
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 // Verifies behavior with a static getter, but no field and no setter. 4 // Verifies behavior with a static getter, but no field and no setter.
5 5
6 import "package:expect/expect.dart";
7
6 class Example { 8 class Example {
7 static int _var = 1; 9 static int _var = 1;
8 static int get nextVar => _var++; 10 static int get nextVar => _var++;
9 Example() { 11 Example() {
10 { 12 {
11 bool flag_exception = false; 13 bool flag_exception = false;
12 try { 14 try {
13 nextVar = 1; // Equivalent to this.nextVar = 1. 15 nextVar = 1; // Equivalent to this.nextVar = 1.
14 } catch (excpt) { 16 } catch (excpt) {
15 flag_exception = true; 17 flag_exception = true;
(...skipping 24 matching lines...) Expand all
40 static int _var = 1; 42 static int _var = 1;
41 static int get nextVar => _var++; 43 static int get nextVar => _var++;
42 Example2() : super(nextVar) { } // No 'this' in scope. 44 Example2() : super(nextVar) { } // No 'this' in scope.
43 } 45 }
44 46
45 void main() { 47 void main() {
46 Example x = new Example(); 48 Example x = new Example();
47 Example.test(); 49 Example.test();
48 Example2 x2 = new Example2(); 50 Example2 x2 = new Example2();
49 } 51 }
OLDNEW
« no previous file with comments | « tests/language/getter_no_setter2_test.dart ('k') | tests/language/getter_setter_in_lib_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698