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

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

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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/instance_incr_deopt_test.dart ('k') | tests/language/instanceof2_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 4
5 import "package:expect/expect.dart";
6
7 // Test inlining of assignments in parameter passing. If [StringScanner.charAt] 5 // Test inlining of assignments in parameter passing. If [StringScanner.charAt]
8 // is inlined, the argument expresion [: ++byteOffset :] should not be 6 // is inlined, the argument expresion [: ++byteOffset :] should not be
9 // duplicated. 7 // duplicated.
10 8
11 class StringScanner { 9 class StringScanner {
12 final String string; 10 final String string;
13 int byteOffset = -1; 11 int byteOffset = -1;
14 12
15 StringScanner(this.string); 13 StringScanner(this.string);
16 14
17 int nextByte() => charAt(++byteOffset); 15 int nextByte() => charAt(++byteOffset);
18 16
19 int charAt(index) 17 int charAt(index)
20 => (string.length > index) ? string.codeUnitAt(index) : -1; 18 => (string.length > index) ? string.codeUnitAt(index) : -1;
21 } 19 }
22 20
23 void main() { 21 void main() {
24 var scanner = new StringScanner('az9'); 22 var scanner = new StringScanner('az9');
25 Expect.equals(0x61, scanner.nextByte()); // Expect a. 23 Expect.equals(0x61, scanner.nextByte()); // Expect a.
26 Expect.equals(0x7A, scanner.nextByte()); // Expect z. 24 Expect.equals(0x7A, scanner.nextByte()); // Expect z.
27 Expect.equals(0x39, scanner.nextByte()); // Expect 9. 25 Expect.equals(0x39, scanner.nextByte()); // Expect 9.
28 Expect.equals(-1, scanner.nextByte()); 26 Expect.equals(-1, scanner.nextByte());
29 } 27 }
OLDNEW
« no previous file with comments | « tests/language/instance_incr_deopt_test.dart ('k') | tests/language/instanceof2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698