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

Unified Diff: tests/corelib/src/StringReplaceTest.dart

Issue 10244009: test rename overhaul: step 7 - corelib tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
Index: tests/corelib/src/StringReplaceTest.dart
diff --git a/tests/corelib/src/StringReplaceTest.dart b/tests/corelib/src/StringReplaceTest.dart
deleted file mode 100644
index 171af371e13cd86fd2eb4073af5f2c20b1afa281..0000000000000000000000000000000000000000
--- a/tests/corelib/src/StringReplaceTest.dart
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2011, 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.
-
-class StringReplaceTest {
- static testMain() {
- Expect.equals(
- "AtoBtoCDtoE", "AfromBtoCDtoE".replaceFirst("from", "to"));
-
- // Test with the replaced string at the begining.
- Expect.equals(
- "toABtoCDtoE", "fromABtoCDtoE".replaceFirst("from", "to"));
-
- // Test with the replaced string at the end.
- Expect.equals(
- "toABtoCDtoEto", "fromABtoCDtoEto".replaceFirst("from", "to"));
-
- // Test when there are no occurence of the string to replace.
- Expect.equals("ABC", "ABC".replaceFirst("from", "to"));
-
- // Test when the string to change is the empty string.
- Expect.equals("", "".replaceFirst("from", "to"));
-
- // Test when the string to change is a substring of the string to
- // replace.
- Expect.equals("fro", "fro".replaceFirst("from", "to"));
-
- // Test when the string to change is the replaced string.
- Expect.equals("to", "from".replaceFirst("from", "to"));
-
- // Test when the string to change is the replacement string.
- Expect.equals("to", "to".replaceFirst("from", "to"));
-
- // Test replacing by the empty string.
- Expect.equals("", "from".replaceFirst("from", ""));
- Expect.equals("AB", "AfromB".replaceFirst("from", ""));
-
- // Test changing the empty string.
- Expect.equals("to", "".replaceFirst("", "to"));
-
- // Test replacing the empty string.
- Expect.equals("toAtoBtoCto", "AtoBtoCto".replaceFirst("", "to"));
- }
-}
-
-main() {
- StringReplaceTest.testMain();
-}

Powered by Google App Engine
This is Rietveld 408576698