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

Unified Diff: tests/corelib/collection_to_string_test.dart

Issue 27028003: Revert toString output changes of Queues, and LinkedLists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test. Created 7 years, 2 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 | « sdk/lib/collection/queue.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/collection_to_string_test.dart
diff --git a/tests/corelib/collection_to_string_test.dart b/tests/corelib/collection_to_string_test.dart
index 7bd19e6d5931fa1684aaa8754313e0c3e93506f9..2f3d4bd400229c08d7b415d0de84e2053c90d711 100644
--- a/tests/corelib/collection_to_string_test.dart
+++ b/tests/corelib/collection_to_string_test.dart
@@ -172,14 +172,15 @@ Object randomCollectionHelper(int size, bool exact, StringBuffer stringRep,
* a collection with ill-defined iteration order (i.e., a HashSet or HashMap).
*/
List randomList(int size, bool exact, StringBuffer stringRep, List beingMade) {
- return populateRandomCollection(size, exact, stringRep, beingMade, []);
+ return populateRandomCollection(size, exact, stringRep, beingMade, [], "[]");
}
/**
* Like randomList, but returns a queue.
*/
Queue randomQueue(int size, bool exact, StringBuffer stringRep, List beingMade){
- return populateRandomCollection(size, exact, stringRep, beingMade, new Queue());
+ return populateRandomCollection(
+ size, exact, stringRep, beingMade, new Queue(), "{}");
}
/**
@@ -214,14 +215,8 @@ Map randomMap(int size, bool exact, StringBuffer stringRep, List beingMade) {
* (i.e., a HashSet or HashMap).
*/
populateRandomCollection(int size, bool exact,
- StringBuffer stringRep, List beingMade, var coll) {
+ StringBuffer stringRep, List beingMade, var coll, String delimiters) {
beingMade.add(coll);
- String delimiters = "()"; // Default for iterables.
- if (coll is List) {
- delimiters = "[]";
- } else if (coll is Set) {
- delimiters = "{}";
- }
int start = stringRep.length;
stringRep.write(delimiters[0]);
@@ -342,7 +337,7 @@ Object randomElement(int size, bool exact, StringBuffer stringRep,
result = beingMade[random(beingMade.length)];
if (result is List) {
stringRep.write('[...]');
- } else if (result is Set || result is Map) {
+ } else if (result is Set || result is Map || result is Queue) {
stringRep.write('{...}');
} else {
stringRep.write('(...)');
« no previous file with comments | « sdk/lib/collection/queue.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698