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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 8363027: Igonre closure classes when looking for duplication. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
===================================================================
--- runtime/vm/dart_api_impl_test.cc (revision 596)
+++ runtime/vm/dart_api_impl_test.cc (working copy)
@@ -1652,6 +1652,45 @@
Dart_ShutdownIsolate();
}
+
+UNIT_TEST_CASE(ImportLibrary5) {
+ const char* kScriptChars =
+ "#import('lib.dart');"
+ "interface Y {"
+ " void set handler(void callback(List<int> x));"
+ "}"
+ "void main() {}";
+ const char* kLibraryChars =
+ "#library('lib.dart');"
+ "interface X {"
+ " void set handler(void callback(List<int> x));"
+ "}";
+ Dart_Result result;
+
+ Dart_CreateIsolate(NULL, NULL);
+ {
+ Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
+
+ // Create a test library and Load up a test script in it.
+ Dart_Handle url = Dart_NewString(TestCase::url());
+ Dart_Handle source = Dart_NewString(kScriptChars);
+ result = Dart_LoadScript(url, source, library_handler);
+
+ url = Dart_NewString("lib.dart");
+ source = Dart_NewString(kLibraryChars);
+ Dart_LoadLibrary(url, source);
+
+ result = Dart_InvokeStatic(Dart_GetResult(result),
+ Dart_NewString(""),
+ Dart_NewString("main"),
+ 0,
+ NULL);
+ assert(Dart_IsValidResult(result));
+
+ Dart_ExitScope(); // Exit the Dart API scope.
+ }
+ Dart_ShutdownIsolate();
+}
siva 2011/10/21 17:20:47 I would also add a test case where we except an er
#endif // TARGET_ARCH_IA32.
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698