| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 4674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4685 } | 4685 } |
| 4686 } | 4686 } |
| 4687 | 4687 |
| 4688 | 4688 |
| 4689 struct TestResult { | 4689 struct TestResult { |
| 4690 const char* in; | 4690 const char* in; |
| 4691 const char* out; | 4691 const char* out; |
| 4692 }; | 4692 }; |
| 4693 | 4693 |
| 4694 | 4694 |
| 4695 VM_TEST_CASE(String_IdentifierPrettyName) { | 4695 VM_TEST_CASE(String_ScrubName) { |
| 4696 TestResult tests[] = { | 4696 TestResult tests[] = { |
| 4697 {"(dynamic, dynamic) => void", "(dynamic, dynamic) => void"}, | 4697 {"(dynamic, dynamic) => void", "(dynamic, dynamic) => void"}, |
| 4698 {"_List@915557746", "_List"}, | 4698 {"_List@915557746", "_List"}, |
| 4699 {"_HashMap@600006304<K, V>(dynamic) => V", "_HashMap<K, V>(dynamic) => V"}, | 4699 {"_HashMap@600006304<K, V>(dynamic) => V", "_HashMap<K, V>(dynamic) => V"}, |
| 4700 {"set:foo", "foo="}, | 4700 {"set:foo", "foo="}, |
| 4701 {"get:foo", "foo"}, | 4701 {"get:foo", "foo"}, |
| 4702 {"_ReceivePortImpl@709387912", "_ReceivePortImpl"}, | 4702 {"_ReceivePortImpl@709387912", "_ReceivePortImpl"}, |
| 4703 {"_ReceivePortImpl@709387912._internal@709387912", | 4703 {"_ReceivePortImpl@709387912._internal@709387912", |
| 4704 "_ReceivePortImpl._internal"}, | 4704 "_ReceivePortImpl._internal"}, |
| 4705 {"_C@6328321&_E@6328321&_F@6328321", "_C&_E&_F"}, | 4705 {"_C@6328321&_E@6328321&_F@6328321", "_C&_E&_F"}, |
| 4706 {"List.", "List"}, | 4706 {"List.", "List"}, |
| 4707 {"get:foo@6328321", "foo"}, | 4707 {"get:foo@6328321", "foo"}, |
| 4708 {"_MyClass@6328321.", "_MyClass"}, | 4708 {"_MyClass@6328321.", "_MyClass"}, |
| 4709 {"_MyClass@6328321.named", "_MyClass.named"}, | 4709 {"_MyClass@6328321.named", "_MyClass.named"}, |
| 4710 }; | 4710 }; |
| 4711 String& test = String::Handle(); | 4711 String& test = String::Handle(); |
| 4712 String& result = String::Handle(); | 4712 String& result = String::Handle(); |
| 4713 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { | 4713 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { |
| 4714 test = String::New(tests[i].in); | 4714 test = String::New(tests[i].in); |
| 4715 result = String::IdentifierPrettyName(test); | 4715 result = String::ScrubName(test); |
| 4716 EXPECT_STREQ(tests[i].out, result.ToCString()); | 4716 EXPECT_STREQ(tests[i].out, result.ToCString()); |
| 4717 } | 4717 } |
| 4718 } | 4718 } |
| 4719 | 4719 |
| 4720 } // namespace dart | 4720 } // namespace dart |
| OLD | NEW |