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

Unified Diff: tests/corelib_strong/string_base_vm_test.dart

Issue 2989473002: Migrated test block 27 to Dart 2.0. (Closed)
Patch Set: Addressed Bob's nits and fixed test failures Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib_strong/stopwatch_test.dart ('k') | tests/corelib_strong/string_buffer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib_strong/string_base_vm_test.dart
diff --git a/tests/corelib_strong/string_base_vm_test.dart b/tests/corelib_strong/string_base_vm_test.dart
deleted file mode 100644
index 76ff9ade8fe80b267e0e5b6e0110bd0b4386658a..0000000000000000000000000000000000000000
--- a/tests/corelib_strong/string_base_vm_test.dart
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-// Dart test program for testing class 'StringBase' (currently VM specific).
-
-library string_base_test;
-
-import "package:expect/expect.dart";
-
-class StringBaseTest {
- StringBaseTest() {}
-
- toString() {
- return "StringBase Tester";
- }
-
- static testInterpolation() {
- var answer = 40 + 2;
- var s = "The answer is $answer.";
- Expect.equals("The answer is 42.", s);
-
- int numBottles = 33;
- String wall = "wall";
- s = "${numBottles*3} bottles of beer on the $wall.";
- Expect.equals("99 bottles of beer on the wall.", s);
- }
-
- static testCreation() {
- String s = "Hello";
- List<int> a = new List(s.length);
- List<int> ga = new List();
- bool exception_caught = false;
- for (int i = 0; i < a.length; i++) {
- a[i] = s.codeUnitAt(i);
- ga.add(s.codeUnitAt(i));
- }
- try {
- String s4 = new String.fromCharCodes([0.0]);
- } on ArgumentError catch (ex) {
- exception_caught = true;
- } on TypeError catch (ex) {
- exception_caught = true;
- }
- Expect.equals(true, exception_caught);
- exception_caught = false;
- try {
- String s4 = new String.fromCharCodes([-1]);
- } on ArgumentError catch (ex) {
- exception_caught = true;
- }
- Expect.equals(true, exception_caught);
- }
-
- static testSubstring() {
- String s = "Hello World";
- Expect.equals("World", s.substring(6, s.length));
- Expect.equals("", s.substring(8, 8));
- bool exception_caught = false;
- try {
- s.substring(5, 12);
- } on RangeError catch (ex) {
- exception_caught = true;
- }
- Expect.equals(true, exception_caught);
- exception_caught = false;
- try {
- s.substring(5, 4);
- } on RangeError catch (ex) {
- exception_caught = true;
- }
- Expect.equals(true, exception_caught);
- }
-
- static void testMain() {
- testInterpolation();
- testCreation();
- testSubstring();
- }
-}
-
-main() {
- StringBaseTest.testMain();
-}
« no previous file with comments | « tests/corelib_strong/stopwatch_test.dart ('k') | tests/corelib_strong/string_buffer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698