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 "vm/assembler.h" | 5 #include "vm/assembler.h" |
6 #include "vm/bigint_operations.h" | 6 #include "vm/bigint_operations.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 EXPECT(elf2.IsSymbol()); | 1606 EXPECT(elf2.IsSymbol()); |
1607 EXPECT_EQ(elf1.raw(), Symbols::New("Elf")); | 1607 EXPECT_EQ(elf1.raw(), Symbols::New("Elf")); |
1608 EXPECT_EQ(elf2.raw(), Symbols::New("Elf")); | 1608 EXPECT_EQ(elf2.raw(), Symbols::New("Elf")); |
1609 } | 1609 } |
1610 | 1610 |
1611 | 1611 |
1612 TEST_CASE(SymbolUnicode) { | 1612 TEST_CASE(SymbolUnicode) { |
1613 uint16_t monkey_utf16[] = { 0xd83d, 0xdc35 }; // Unicode Monkey Face. | 1613 uint16_t monkey_utf16[] = { 0xd83d, 0xdc35 }; // Unicode Monkey Face. |
1614 String& monkey = String::Handle(Symbols::FromUTF16(monkey_utf16, 2)); | 1614 String& monkey = String::Handle(Symbols::FromUTF16(monkey_utf16, 2)); |
1615 EXPECT(monkey.IsSymbol()); | 1615 EXPECT(monkey.IsSymbol()); |
1616 const char monkey_utf8[] = {0xf0, 0x9f, 0x90, 0xb5, 0}; | 1616 const char monkey_utf8[] = {'\xf0', '\x9f', '\x90', '\xb5', 0}; |
1617 EXPECT_EQ(monkey.raw(), Symbols::New(monkey_utf8)); | 1617 EXPECT_EQ(monkey.raw(), Symbols::New(monkey_utf8)); |
1618 | 1618 |
1619 int32_t kMonkeyFace = 0x1f435; | 1619 int32_t kMonkeyFace = 0x1f435; |
1620 String& monkey2 = String::Handle(Symbols::FromCharCode(kMonkeyFace)); | 1620 String& monkey2 = String::Handle(Symbols::FromCharCode(kMonkeyFace)); |
1621 EXPECT_EQ(monkey.raw(), monkey2.raw()); | 1621 EXPECT_EQ(monkey.raw(), monkey2.raw()); |
1622 | 1622 |
1623 // Unicode cat face with tears of joy. | 1623 // Unicode cat face with tears of joy. |
1624 int32_t kCatFaceWithTearsOfJoy = 0x1f639; | 1624 int32_t kCatFaceWithTearsOfJoy = 0x1f639; |
1625 String& cat = String::Handle(Symbols::FromCharCode(kCatFaceWithTearsOfJoy)); | 1625 String& cat = String::Handle(Symbols::FromCharCode(kCatFaceWithTearsOfJoy)); |
1626 | 1626 |
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3363 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); | 3363 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); |
3364 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); | 3364 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); |
3365 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); | 3365 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); |
3366 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); | 3366 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); |
3367 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); | 3367 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); |
3368 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); | 3368 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); |
3369 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); | 3369 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); |
3370 } | 3370 } |
3371 | 3371 |
3372 } // namespace dart | 3372 } // namespace dart |
OLD | NEW |