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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/string_test.dart ('k') | tests/language/type_vm_test.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 // VMOptions=--no_show_internal_names 4 // VMOptions=--no_show_internal_names
5 // 5 //
6 // Dart test program testing type casts. 6 // Dart test program testing type casts.
7 7
8 // Test that the initializer expression gets properly skipped. 8 // Test that the initializer expression gets properly skipped.
9 bool b = "foo" as double; 9 bool b = "foo" as double;
10 10
(...skipping 20 matching lines...) Expand all
31 return result; 31 return result;
32 } 32 }
33 33
34 static testSideEffect() { 34 static testSideEffect() {
35 int result = 0; 35 int result = 0;
36 int index() { 36 int index() {
37 result++; 37 result++;
38 return 0; 38 return 0;
39 } 39 }
40 try { 40 try {
41 var a = new List<int>(1) as List<int>; 41 var a = new List<int>.fixedLength(1) as List<int>;
42 a[0] = 0; 42 a[0] = 0;
43 a[index()]++; // Type check succeeds, but does not create side effects. 43 a[index()]++; // Type check succeeds, but does not create side effects.
44 Expect.equals(1, a[0]); 44 Expect.equals(1, a[0]);
45 } on TypeError catch (error) { 45 } on TypeError catch (error) {
46 result = 100; 46 result = 100;
47 } 47 }
48 return result; 48 return result;
49 } 49 }
50 50
51 static testArgument() { 51 static testArgument() {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Expect.equals(1, testReturn()); 153 Expect.equals(1, testReturn());
154 Expect.equals(1, testField()); 154 Expect.equals(1, testField());
155 Expect.equals(1, testAnyFunction()); 155 Expect.equals(1, testAnyFunction());
156 } 156 }
157 } 157 }
158 158
159 159
160 main() { 160 main() {
161 TypeTest.testMain(); 161 TypeTest.testMain();
162 } 162 }
OLDNEW
« no previous file with comments | « tests/language/string_test.dart ('k') | tests/language/type_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698