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

Unified Diff: tests/corelib_2/string_replace_test.dart

Issue 2983273002: Migrated test block 28 to Dart 2.0. (Closed)
Patch Set: Updated status file to fix failing test 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_2/string_replace_static_test.dart ('k') | tests/corelib_2/string_runes_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib_2/string_replace_test.dart
diff --git a/tests/corelib/string_replace_test.dart b/tests/corelib_2/string_replace_test.dart
similarity index 90%
rename from tests/corelib/string_replace_test.dart
rename to tests/corelib_2/string_replace_test.dart
index 80bbe4cc2427bcec6ff75dcabcfffd504b200485..4599c6e1ffb37e3ee79eb10edb860544b2b5bf02 100644
--- a/tests/corelib/string_replace_test.dart
+++ b/tests/corelib_2/string_replace_test.dart
@@ -78,11 +78,7 @@ main() {
Expect.throws(
() => "hello".replaceFirst("h", "X", null), (e) => e is ArgumentError);
- // Test object startIndex
- Expect.throws(() => "hello".replaceFirst("h", "X", new Object()));
-
// Test replaceFirstMapped.
-
Expect.equals(
"AtoBtoCDtoE", "AfromBtoCDtoE".replaceFirstMapped("from", (_) => "to"));
@@ -160,10 +156,6 @@ main() {
Expect.throws(() => "hello".replaceFirstMapped("h", (_) => "X", null),
(e) => e is ArgumentError);
- // Test object startIndex
- Expect
- .throws(() => "hello".replaceFirstMapped("h", (_) => "X", new Object()));
-
// Test replacement depending on argument.
Expect.equals("foo-BAR-foo-bar",
"foo-bar-foo-bar".replaceFirstMapped("bar", (v) => v[0].toUpperCase()));
@@ -186,18 +178,6 @@ main() {
return o;
}));
- Expect.equals(
- "foo-42",
- "foo-bar".replaceFirstMapped("bar", (v) {
- return 42;
- }));
-
- // Test replacement returning object throwing on string-conversion.
- var n = new Naughty();
- Expect.throws(() => "foo-bar".replaceFirstMapped("bar", (v) {
- return n;
- }));
-
for (var string in ["", "x", "foo", "x\u2000z"]) {
for (var replacement in ["", "foo", string]) {
for (int start = 0; start <= string.length; start++) {
@@ -214,14 +194,7 @@ main() {
}
}
Expect.throws(() => string.replaceRange(0, 0, null));
- Expect.throws(() => string.replaceRange(0, 0, 42));
- Expect.throws(() => string.replaceRange(0, 0, ["x"]));
Expect.throws(() => string.replaceRange(-1, 0, "x"));
Expect.throws(() => string.replaceRange(0, string.length + 1, "x"));
}
}
-
-// Fails to return a String on toString, throws if converted by "$naughty".
-class Naughty {
- toString() => this;
-}
« no previous file with comments | « tests/corelib_2/string_replace_static_test.dart ('k') | tests/corelib_2/string_runes_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698