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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 22642003: Fix name of libraries without a library declaration to be the empty string. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 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 | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 8be7d0ad3263b89b7bc33721314605e5424d4e2e..061af76a604902b370e8bed41f385ac682aaffcb 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -4464,6 +4464,7 @@ TEST_CASE(GetNativeArgumentCount) {
TEST_CASE(GetType) {
const char* kScriptChars =
+ "library testlib;\n"
"class Class {\n"
" static var name = 'Class';\n"
"}\n"
@@ -4495,7 +4496,7 @@ TEST_CASE(GetType) {
// Lookup a class that does not exist.
type = Dart_GetType(lib, NewString("DoesNotExist"), 0, NULL);
EXPECT(Dart_IsError(type));
- EXPECT_STREQ("Type 'DoesNotExist' not found in library 'dart:test-lib'.",
+ EXPECT_STREQ("Type 'DoesNotExist' not found in library 'testlib'.",
Dart_GetError(type));
// Lookup a class from an error library. The error propagates.
@@ -4654,6 +4655,7 @@ TEST_CASE(LoadScript) {
TEST_CASE(RootLibrary) {
const char* kScriptChars =
+ "library testlib;"
"main() {"
" return 12345;"
"}";
@@ -4673,7 +4675,14 @@ TEST_CASE(RootLibrary) {
EXPECT(!Dart_IsNull(root_lib));
const char* name_cstr = "";
EXPECT_VALID(Dart_StringToCString(lib_name, &name_cstr));
- EXPECT_STREQ(TestCase::url(), name_cstr);
+ EXPECT_STREQ("testlib", name_cstr);
+
+ Dart_Handle lib_uri = Dart_LibraryUrl(root_lib);
+ EXPECT_VALID(lib_uri);
+ EXPECT(!Dart_IsNull(lib_uri));
+ const char* uri_cstr = "";
+ EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
+ EXPECT_STREQ(TestCase::url(), uri_cstr);
}
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698