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

Unified Diff: vm/dart_api_impl_test.cc

Issue 10911025: Get rid of support for string interpolation in #import strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/object_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_api_impl_test.cc
===================================================================
--- vm/dart_api_impl_test.cc (revision 11672)
+++ vm/dart_api_impl_test.cc (working copy)
@@ -4822,12 +4822,6 @@
}
-static const char* var_mapping[] = {
- "GOOGLE3", ".",
- "ABC", "lala",
- "var1", "",
- "var2", "winner",
-};
static int index = 0;
@@ -4865,72 +4859,6 @@
}
-TEST_CASE(LoadImportScript) {
- const char* kScriptChars =
- "#import('$GOOGLE3/weird.dart');"
- "#import('abc${ABC}def');"
- "#import('${var1}$var2');"
- "#import('abc${ABC}def/extra_weird.dart');"
- "#import('$var2$var2');"
- "main() {"
- " return 12345;"
- "}";
- Dart_Handle url = Dart_NewString(TestCase::url());
- Dart_Handle source = Dart_NewString(kScriptChars);
- intptr_t length = (sizeof(var_mapping) / sizeof(var_mapping[0]));
- Dart_Handle import_map = Dart_NewList(length);
- for (intptr_t i = 0; i < length; i++) {
- Dart_ListSetAt(import_map, i, Dart_NewString(var_mapping[i]));
- }
- Dart_Handle result = Dart_SetLibraryTagHandler(import_library_handler);
- EXPECT_VALID(result);
- result = Dart_SetImportMap(import_map);
- EXPECT_VALID(result);
- result = Dart_LoadScript(url, source);
- EXPECT_VALID(result);
-}
-
-
-TEST_CASE(LoadImportScriptError1) {
- const char* kScriptChars =
- "#import('abc${DEF}def/extra_weird.dart');"
- "main() {"
- " return 12345;"
- "}";
- Dart_Handle url = Dart_NewString(TestCase::url());
- Dart_Handle source = Dart_NewString(kScriptChars);
- Dart_Handle result = Dart_SetLibraryTagHandler(import_library_handler);
- EXPECT_VALID(result);
- result = Dart_LoadScript(url, source);
- EXPECT(Dart_IsError(result));
- EXPECT(strstr(Dart_GetError(result),
- "import variable 'DEF' has not been defined"));
-}
-
-
-TEST_CASE(LoadImportScriptError2) {
- const char* kScriptChars =
- "#import('abc${ABC/extra_weird.dart');"
- "main() {"
- " return 12345;"
- "}";
- Dart_Handle url = Dart_NewString(TestCase::url());
- Dart_Handle source = Dart_NewString(kScriptChars);
- intptr_t length = (sizeof(var_mapping) / sizeof(var_mapping[0]));
- Dart_Handle import_map = Dart_NewList(length);
- for (intptr_t i = 0; i < length; i++) {
- Dart_ListSetAt(import_map, i, Dart_NewString(var_mapping[i]));
- }
- Dart_Handle result = Dart_SetLibraryTagHandler(import_library_handler);
- EXPECT_VALID(result);
- result = Dart_SetImportMap(import_map);
- EXPECT_VALID(result);
- result = Dart_LoadScript(url, source);
- EXPECT(Dart_IsError(result));
- EXPECT(strstr(Dart_GetError(result), "'}' expected"));
-}
-
-
TEST_CASE(LoadScript_CompileError) {
const char* kScriptChars =
")";
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698