Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: runtime/vm/object_test.cc

Issue 1661413002: Improve regenerated source code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698