Chromium Code Reviews| 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())); |
| +} |