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

Unified Diff: dart/tests/language/string_interpolation_and_buffer.dart

Issue 11565034: Improve performance of dart2js StringBuffer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated to lib_v2 and private libraries. Created 7 years, 11 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 | « dart/sdk/lib/core/string_buffer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/language/string_interpolation_and_buffer.dart
diff --git a/dart/tests/language/string_interpolation_and_buffer.dart b/dart/tests/language/string_interpolation_and_buffer.dart
index 2e25375a5e8ea4ce3a32ff363580ba0acdbbe669..1ce359dc30b0f4bde01100f52cb78ce7cd6a4499 100644
--- a/dart/tests/language/string_interpolation_and_buffer.dart
+++ b/dart/tests/language/string_interpolation_and_buffer.dart
@@ -56,6 +56,25 @@ main() {
return 'Success';
}
+ initBuffer(object) {
+ var sb;
+ if (checkedMode && object != null) {
+ try {
+ sb = new StringBuffer(wrap(object));
+ } on TypeError {
+ return 'Error';
+ }
+ } else {
+ try {
+ sb = new StringBuffer(wrap(object));
+ } on ArgumentError {
+ return 'Error';
+ }
+ Expect.isTrue(sb.toString() is String);
+ }
+ return 'Success';
+ }
+
Expect.equals('Error', interpolate(null));
Expect.equals('Success', interpolate(""));
Expect.equals('Success', interpolate("string"));
@@ -69,4 +88,11 @@ main() {
Expect.equals('Error', buffer([]));
Expect.equals('Error', buffer([1]));
Expect.equals('Error', buffer(new Object()));
+
+ Expect.equals('Error', initBuffer(null));
+ Expect.equals('Success', initBuffer(""));
+ Expect.equals('Success', initBuffer("string"));
+ Expect.equals('Error', initBuffer([]));
+ Expect.equals('Error', initBuffer([1]));
+ Expect.equals('Error', initBuffer(new Object()));
}
« no previous file with comments | « dart/sdk/lib/core/string_buffer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698