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

Side by Side Diff: tests/corelib/string_base_vm_test.dart

Issue 11275042: Renaming IndexOutOfRangeException to RangeError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 // Dart test program for testing class 'StringBase' (currently VM specific). 4 // Dart test program for testing class 'StringBase' (currently VM specific).
5 5
6 #library("StringBaseTest.dart"); 6 #library("StringBaseTest.dart");
7 7
8 class StringBaseTest { 8 class StringBaseTest {
9 9
10 StringBaseTest() {} 10 StringBaseTest() {}
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 Expect.equals(true, exception_caught); 48 Expect.equals(true, exception_caught);
49 } 49 }
50 50
51 static testSubstring() { 51 static testSubstring() {
52 String s = "Hello World"; 52 String s = "Hello World";
53 Expect.equals("World", s.substring(6, s.length)); 53 Expect.equals("World", s.substring(6, s.length));
54 Expect.equals("", s.substring(8, 8)); 54 Expect.equals("", s.substring(8, 8));
55 bool exception_caught = false; 55 bool exception_caught = false;
56 try { 56 try {
57 s.substring(5, 12); 57 s.substring(5, 12);
58 } on IndexOutOfRangeException catch (ex) { 58 } on RangeError catch (ex) {
59 exception_caught = true; 59 exception_caught = true;
60 } 60 }
61 Expect.equals(true, exception_caught); 61 Expect.equals(true, exception_caught);
62 exception_caught = false; 62 exception_caught = false;
63 try { 63 try {
64 s.substring(5, 4); 64 s.substring(5, 4);
65 } on IndexOutOfRangeException catch (ex) { 65 } on RangeError catch (ex) {
66 exception_caught = true; 66 exception_caught = true;
67 } 67 }
68 Expect.equals(true, exception_caught); 68 Expect.equals(true, exception_caught);
69 } 69 }
70 70
71 static void testMain() { 71 static void testMain() {
72 testInterpolation(); 72 testInterpolation();
73 testCreation(); 73 testCreation();
74 testSubstring(); 74 testSubstring();
75 } 75 }
76 } 76 }
77 77
78 main() { 78 main() {
79 StringBaseTest.testMain(); 79 StringBaseTest.testMain();
80 } 80 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698