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

Unified Diff: dart/tests/corelib/safe_to_string_test.dart

Issue 10939020: Don't invoke user-defined code in NoSuchMethodError.toString. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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/runtime/lib/lib_sources.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/corelib/safe_to_string_test.dart
diff --git a/dart/tests/corelib/safe_to_string_test.dart b/dart/tests/corelib/safe_to_string_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f9eeac84fe1e428abc39e82d2c7b0380d370d483
--- /dev/null
+++ b/dart/tests/corelib/safe_to_string_test.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2012, 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.
+
+main() {
+ Expect.stringEquals('1', NoSuchMethodError.safeToString(1));
+ Expect.stringEquals('0.5', NoSuchMethodError.safeToString(0.5));
+ Expect.stringEquals('"1"', NoSuchMethodError.safeToString("1"));
kasperl 2012/09/19 06:26:36 Add test for the escaping of " in strings?
ahe 2012/09/19 07:47:52 Done.
+ Expect.stringEquals('null', NoSuchMethodError.safeToString(null));
+ Expect.stringEquals('true', NoSuchMethodError.safeToString(true));
+ Expect.stringEquals('false', NoSuchMethodError.safeToString(false));
+ Expect.stringEquals("Instance of 'Object'",
+ NoSuchMethodError.safeToString(new Object()));
+}
« no previous file with comments | « dart/runtime/lib/lib_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698