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

Unified Diff: tests/corelib/string_buffer_test.dart

Issue 12473003: Remove deprecated StringBuffer.add, addAll and addCharCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/string_buffer_test.dart
diff --git a/tests/corelib/string_buffer_test.dart b/tests/corelib/string_buffer_test.dart
index 5fcde73678ac47d0d3cfed86b11c7b02d2dcd8ef..056321bc471a25f2a72b15b0a803858b34ed4da3 100644
--- a/tests/corelib/string_buffer_test.dart
+++ b/tests/corelib/string_buffer_test.dart
@@ -14,53 +14,53 @@ class StringBufferTest {
Expect.equals("abc", bf.toString());
}
- static testAdd() {
+ static testWrite() {
StringBuffer bf = new StringBuffer("");
Expect.equals(true, bf.isEmpty);
- bf.add("a");
+ bf.write("a");
Expect.equals(1, bf.length);
Expect.equals("a", bf.toString());
bf = new StringBuffer("");
- bf.add("a");
- bf.add("b");
+ bf.write("a");
+ bf.write("b");
Expect.equals("ab", bf.toString());
bf = new StringBuffer("abc");
- bf.add("d");
- bf.add("e");
- bf.add("f");
- bf.add("g");
- bf.add("h");
- bf.add("i");
- bf.add("j");
- bf.add("k");
- bf.add("l");
- bf.add("m");
- bf.add("n");
- bf.add("o");
- bf.add("p");
- bf.add("q");
- bf.add("r");
- bf.add("s");
- bf.add("t");
- bf.add("u");
- bf.add("v");
- bf.add("w");
- bf.add("x");
- bf.add("y");
- bf.add("z");
- bf.add("\n");
- bf.add("thequickbrownfoxjumpsoverthelazydog");
+ bf.write("d");
+ bf.write("e");
+ bf.write("f");
+ bf.write("g");
+ bf.write("h");
+ bf.write("i");
+ bf.write("j");
+ bf.write("k");
+ bf.write("l");
+ bf.write("m");
+ bf.write("n");
+ bf.write("o");
+ bf.write("p");
+ bf.write("q");
+ bf.write("r");
+ bf.write("s");
+ bf.write("t");
+ bf.write("u");
+ bf.write("v");
+ bf.write("w");
+ bf.write("x");
+ bf.write("y");
+ bf.write("z");
+ bf.write("\n");
+ bf.write("thequickbrownfoxjumpsoverthelazydog");
Expect.equals("abcdefghijklmnopqrstuvwxyz\n"
"thequickbrownfoxjumpsoverthelazydog",
bf.toString());
bf = new StringBuffer("");
for (int i = 0; i < 100000; i++) {
- bf.add('');
- bf.add("");
+ bf.write('');
+ bf.write("");
}
Expect.equals("", bf.toString());
}
@@ -68,48 +68,33 @@ class StringBufferTest {
static testLength() {
StringBuffer bf = new StringBuffer("");
Expect.equals(0, bf.length);
- bf.add("foo");
+ bf.write("foo");
Expect.equals(3, bf.length);
- bf.add("bar");
+ bf.write("bar");
Expect.equals(6, bf.length);
- bf.add("");
+ bf.write("");
Expect.equals(6, bf.length);
}
static testIsEmpty() {
StringBuffer bf = new StringBuffer("");
Expect.equals(true, bf.isEmpty);
- bf.add("foo");
+ bf.write("foo");
Expect.equals(false, bf.isEmpty);
}
- static testAddAll() {
+ static testWriteAll() {
StringBuffer bf = new StringBuffer("");
- bf.addAll(["foo", "bar", "a", "b", "c"]);
+ bf.writeAll(["foo", "bar", "a", "b", "c"]);
Expect.equals("foobarabc", bf.toString());
- bf.addAll([]);
+ bf.writeAll([]);
Expect.equals("foobarabc", bf.toString());
- bf.addAll(["", "", ""]);
+ bf.writeAll(["", "", ""]);
Expect.equals("foobarabc", bf.toString());
}
- static testClear() {
- StringBuffer bf = new StringBuffer("");
- bf.add("foo");
- bf.clear();
- Expect.equals("", bf.toString());
- Expect.equals(0, bf.length);
-
- bf.add("bar");
- Expect.equals("bar", bf.toString());
- Expect.equals(3, bf.length);
- bf.clear();
- Expect.equals("", bf.toString());
- Expect.equals(0, bf.length);
- }
-
static testToString() {
StringBuffer bf = new StringBuffer("");
Expect.equals("", bf.toString());
@@ -118,19 +103,19 @@ class StringBufferTest {
Expect.equals("foo", bf.toString());
bf = new StringBuffer("foo");
- bf.add("bar");
+ bf.write("bar");
Expect.equals("foobar", bf.toString());
}
static testChaining() {
StringBuffer bf = new StringBuffer("");
StringBuffer bf2 = new StringBuffer("");
- bf2.add("bf2");
- bf..add("foo")
- ..add("bar")
- ..add(bf2)
- ..add(bf2)
- ..add("toto");
+ bf2.write("bf2");
+ bf..write("foo")
+ ..write("bar")
+ ..write(bf2)
+ ..write(bf2)
+ ..write("toto");
Expect.equals("foobarbf2bf2toto", bf.toString());
}
@@ -139,9 +124,8 @@ class StringBufferTest {
testConstructor();
testLength();
testIsEmpty();
- testAdd();
- testAddAll();
- testClear();
+ testWrite();
+ testWriteAll();
testChaining();
}
}

Powered by Google App Engine
This is Rietveld 408576698