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

Unified Diff: runtime/vm/compiler_test.cc

Issue 60993002: Add ability for Function to generate source (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler_test.cc
diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc
index fcee41e6f55a58bb31abe0028b9bc60fcbdaa64d..12c389f35d758f44a65c416cad1542bcf95422d1 100644
--- a/runtime/vm/compiler_test.cc
+++ b/runtime/vm/compiler_test.cc
@@ -50,7 +50,8 @@ TEST_CASE(CompileFunction) {
Function& function_foo =
Function::Handle(cls.LookupStaticFunction(function_foo_name));
EXPECT(!function_foo.IsNull());
-
+ String& function_source = String::Handle(function_foo.GenerateSource());
+ EXPECT_STREQ("static foo() {return 42; }", function_source.ToCString());
EXPECT(CompilerTest::TestCompileFunction(function_foo));
EXPECT(function_foo.HasCode());
@@ -61,6 +62,8 @@ TEST_CASE(CompileFunction) {
EXPECT(CompilerTest::TestCompileFunction(function_moo));
EXPECT(function_moo.HasCode());
+ function_source = function_moo.GenerateSource();
+ EXPECT_STREQ("static moo() {\n \n}", function_source.ToCString());
}
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698