| OLD | NEW |
| 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 string_base_test; | 6 library string_base_test; |
| 7 | 7 |
| 8 class StringBaseTest { | 8 class StringBaseTest { |
| 9 | 9 |
| 10 StringBaseTest() {} | 10 StringBaseTest() {} |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 List<int> ga = new List(); | 30 List<int> ga = new List(); |
| 31 bool exception_caught = false; | 31 bool exception_caught = false; |
| 32 for (int i = 0; i < a.length; i++) { | 32 for (int i = 0; i < a.length; i++) { |
| 33 a[i] = s.codeUnitAt(i); | 33 a[i] = s.codeUnitAt(i); |
| 34 ga.add(s.codeUnitAt(i)); | 34 ga.add(s.codeUnitAt(i)); |
| 35 } | 35 } |
| 36 try { | 36 try { |
| 37 String s4 = new String.fromCharCodes([0.0]); | 37 String s4 = new String.fromCharCodes([0.0]); |
| 38 } on ArgumentError catch (ex) { | 38 } on ArgumentError catch (ex) { |
| 39 exception_caught = true; | 39 exception_caught = true; |
| 40 } on TypeError catch (ex) { |
| 41 exception_caught = true; |
| 40 } | 42 } |
| 41 Expect.equals(true, exception_caught); | 43 Expect.equals(true, exception_caught); |
| 42 exception_caught = false; | 44 exception_caught = false; |
| 43 try { | 45 try { |
| 44 String s4 = new String.fromCharCodes([-1]); | 46 String s4 = new String.fromCharCodes([-1]); |
| 45 } on ArgumentError catch (ex) { | 47 } on ArgumentError catch (ex) { |
| 46 exception_caught = true; | 48 exception_caught = true; |
| 47 } | 49 } |
| 48 Expect.equals(true, exception_caught); | 50 Expect.equals(true, exception_caught); |
| 49 } | 51 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 71 static void testMain() { | 73 static void testMain() { |
| 72 testInterpolation(); | 74 testInterpolation(); |
| 73 testCreation(); | 75 testCreation(); |
| 74 testSubstring(); | 76 testSubstring(); |
| 75 } | 77 } |
| 76 } | 78 } |
| 77 | 79 |
| 78 main() { | 80 main() { |
| 79 StringBaseTest.testMain(); | 81 StringBaseTest.testMain(); |
| 80 } | 82 } |
| OLD | NEW |