| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 VM_TEST_CASE(GenerateExactSource) { | 190 VM_TEST_CASE(GenerateExactSource) { |
| 191 // Verify the exact formatting of generated sources. | 191 // Verify the exact formatting of generated sources. |
| 192 const char* kScriptChars = | 192 const char* kScriptChars = |
| 193 "\n" | 193 "\n" |
| 194 "class A {\n" | 194 "class A {\n" |
| 195 " static bar() { return 42; }\n" | 195 " static bar() { return 42; }\n" |
| 196 " static fly() { return 5; }\n" | 196 " static fly() { return 5; }\n" |
| 197 " void catcher(x) {\n" | 197 " void catcher(x) {\n" |
| 198 " try {\n" | 198 " try {\n" |
| 199 " if (x) {\n" | 199 " if (x is! List) {\n" |
| 200 " fly();\n" | 200 " for (int i = 0; i < x; i++) {\n" |
| 201 " fly();\n" |
| 202 " ++i;\n" |
| 203 " }\n" |
| 201 " } else {\n" | 204 " } else {\n" |
| 202 " !fly();\n" | 205 " for (int i = 0; i < x; i--) {\n" |
| 206 " !fly();\n" |
| 207 " --i;\n" |
| 208 " }\n" |
| 203 " }\n" | 209 " }\n" |
| 204 " } on Blah catch (a) {\n" | 210 " } on Blah catch (a) {\n" |
| 205 " _print(17);\n" | 211 " _print(17);\n" |
| 206 " } catch (e, s) {\n" | 212 " } catch (e, s) {\n" |
| 207 " bar()\n" | 213 " bar()\n" |
| 208 " }\n" | 214 " }\n" |
| 209 " }\n" | 215 " }\n" |
| 210 "}\n"; | 216 "}\n"; |
| 211 | 217 |
| 212 String& url = String::Handle(String::New("dart-test:GenerateExactSource")); | 218 String& url = String::Handle(String::New("dart-test:GenerateExactSource")); |
| (...skipping 4483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4696 String& test = String::Handle(); | 4702 String& test = String::Handle(); |
| 4697 String& result = String::Handle(); | 4703 String& result = String::Handle(); |
| 4698 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { | 4704 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { |
| 4699 test = String::New(tests[i].in); | 4705 test = String::New(tests[i].in); |
| 4700 result = String::IdentifierPrettyName(test); | 4706 result = String::IdentifierPrettyName(test); |
| 4701 EXPECT_STREQ(tests[i].out, result.ToCString()); | 4707 EXPECT_STREQ(tests[i].out, result.ToCString()); |
| 4702 } | 4708 } |
| 4703 } | 4709 } |
| 4704 | 4710 |
| 4705 } // namespace dart | 4711 } // namespace dart |
| OLD | NEW |