| 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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.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_api_message.h" | 10 #include "vm/dart_api_message.h" |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 EXPECT(root->value.as_byte_array.values == NULL); | 713 EXPECT(root->value.as_byte_array.values == NULL); |
| 714 CheckEncodeDecodeMessage(root); | 714 CheckEncodeDecodeMessage(root); |
| 715 } | 715 } |
| 716 | 716 |
| 717 | 717 |
| 718 TEST_CASE(SerializeScript) { | 718 TEST_CASE(SerializeScript) { |
| 719 const char* kScriptChars = | 719 const char* kScriptChars = |
| 720 "class A {\n" | 720 "class A {\n" |
| 721 " static bar() { return 42; }\n" | 721 " static bar() { return 42; }\n" |
| 722 " static fly() { return 5; }\n" | 722 " static fly() { return 5; }\n" |
| 723 " static s1() { return 'this is a string in the source'; }\n" |
| 724 " static s2() { return 'this is a \"string\" in the source'; }\n" |
| 725 " static s3() { return 'this is a \\\'string\\\' in \"the\" source'; }\n" |
| 726 " static s4() { return 'this \"is\" a \"string\" in \"the\" source'; }\n" |
| 723 "}\n"; | 727 "}\n"; |
| 724 | 728 |
| 725 String& url = String::Handle(String::New("dart-test:SerializeScript")); | 729 String& url = String::Handle(String::New("dart-test:SerializeScript")); |
| 726 String& source = String::Handle(String::New(kScriptChars)); | 730 String& source = String::Handle(String::New(kScriptChars)); |
| 727 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); | 731 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); |
| 728 const String& lib_url = String::Handle(String::NewSymbol("TestLib")); | 732 const String& lib_url = String::Handle(String::NewSymbol("TestLib")); |
| 729 Library& lib = Library::Handle(Library::New(lib_url)); | 733 Library& lib = Library::Handle(Library::New(lib_url)); |
| 730 lib.Register(); | 734 lib.Register(); |
| 731 EXPECT(CompilerTest::TestCompileScript(lib, script)); | 735 EXPECT(CompilerTest::TestCompileScript(lib, script)); |
| 732 | 736 |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 EXPECT(Dart_ErrorHasException(result)); | 1542 EXPECT(Dart_ErrorHasException(result)); |
| 1539 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", | 1543 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", |
| 1540 Dart_GetError(result)); | 1544 Dart_GetError(result)); |
| 1541 | 1545 |
| 1542 Dart_ExitScope(); | 1546 Dart_ExitScope(); |
| 1543 } | 1547 } |
| 1544 | 1548 |
| 1545 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1549 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 1546 | 1550 |
| 1547 } // namespace dart | 1551 } // namespace dart |
| OLD | NEW |