Chromium Code Reviews| 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 4708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4719 }; | 4719 }; |
| 4720 String& test = String::Handle(); | 4720 String& test = String::Handle(); |
| 4721 String& result = String::Handle(); | 4721 String& result = String::Handle(); |
| 4722 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { | 4722 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { |
| 4723 test = String::New(tests[i].in); | 4723 test = String::New(tests[i].in); |
| 4724 result = String::ScrubName(test); | 4724 result = String::ScrubName(test); |
| 4725 EXPECT_STREQ(tests[i].out, result.ToCString()); | 4725 EXPECT_STREQ(tests[i].out, result.ToCString()); |
| 4726 } | 4726 } |
| 4727 } | 4727 } |
| 4728 | 4728 |
| 4729 | |
| 4730 VM_TEST_CASE(String_EqualsUTF32) { | |
|
hausner
2016/10/06 22:14:41
Maybe a short comment what is being tested here an
rmacnak
2016/10/06 23:16:29
Done.
| |
| 4731 int32_t char_codes[] = { | |
| 4732 0, 0x0a, 0x0d, 0x7f, 0xff, 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff | |
| 4733 }; | |
| 4734 | |
| 4735 const String& str = | |
| 4736 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); | |
| 4737 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); | |
| 4738 } | |
| 4739 | |
| 4729 } // namespace dart | 4740 } // namespace dart |
| OLD | NEW |