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

Unified Diff: runtime/vm/snapshot_test.cc

Issue 36323003: - Ensure that the token stream from generated source matches the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/scanner.cc ('K') | « runtime/vm/scanner_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot_test.cc
===================================================================
--- runtime/vm/snapshot_test.cc (revision 28974)
+++ runtime/vm/snapshot_test.cc (working copy)
@@ -875,6 +875,36 @@
" static s2() { return 'this is a \"string\" in the source'; }\n"
" static s3() { return 'this is a \\\'string\\\' in \"the\" source'; }\n"
" static s4() { return 'this \"is\" a \"string\" in \"the\" source'; }\n"
+ " static ms1() {\n"
+ " return '''\n"
+ "abc\n"
+ "def\n"
+ "ghi''';\n"
+ " }\n"
+ " static ms2() {\n"
+ " return '''\n"
+ "abc\n"
+ "$def\n"
+ "ghi''';\n"
+ " }\n"
+ " static ms3() {\n"
+ " return '''\n"
+ "a b c\n"
+ "d $d e\n"
+ "g h i''';\n"
+ " }\n"
+ " static ms4() {\n"
+ " return '''\n"
+ "abc\n"
+ "${def}\n"
+ "ghi''';\n"
+ " }\n"
+ " static ms5() {\n"
+ " return '''\n"
+ "a b c\n"
+ "d ${d} e\n"
+ "g h i''';\n"
+ " }\n"
"}\n";
String& url = String::Handle(String::New("dart-test:SerializeScript"));
@@ -940,34 +970,29 @@
static void IterateScripts(const Library& lib) {
const Array& lib_scripts = Array::Handle(lib.LoadedScripts());
Script& script = Script::Handle();
+ String& uri = String::Handle();
for (intptr_t i = 0; i < lib_scripts.Length(); i++) {
script ^= lib_scripts.At(i);
EXPECT(!script.IsNull());
+ uri = script.url();
+ OS::Print("Generating source for part: %s\n", uri.ToCString());
GenerateSourceAndCheck(script);
}
}
TEST_CASE(GenerateSource) {
+ Isolate* isolate = Isolate::Current();
+ const GrowableObjectArray& libs = GrowableObjectArray::Handle(
+ isolate, isolate->object_store()->libraries());
Library& lib = Library::Handle();
- // Check core lib.
- lib = Library::CoreLibrary();
- EXPECT(!lib.IsNull());
- IterateScripts(lib);
-
- // Check isolate lib.
- lib = Library::IsolateLibrary();
- EXPECT(!lib.IsNull());
- IterateScripts(lib);
-
- // Check math lib.
- lib = Library::MathLibrary();
- EXPECT(!lib.IsNull());
- IterateScripts(lib);
-
- // Check mirrors lib.
- lib = Library::MirrorsLibrary();
- EXPECT(!lib.IsNull());
- IterateScripts(lib);
+ String& uri = String::Handle();
+ for (intptr_t i = 0; i < libs.Length(); i++) {
+ lib ^= libs.At(i);
+ EXPECT(!lib.IsNull());
+ uri = lib.url();
+ OS::Print("Generating source for library: %s\n", uri.ToCString());
+ IterateScripts(lib);
+ }
}
« runtime/vm/scanner.cc ('K') | « runtime/vm/scanner_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698