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

Unified Diff: compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java

Issue 9702034: Removes dartc reliance on its own libraries, now can be targeted at any implementation's libraries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: junit tests fixed Created 8 years, 9 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 | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | compiler/lib/clock.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java b/compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java
index 10f4d6c8061e50c075476a18e885221ce79512bd..9e76c3ef61facbe39e031b0f2e9424ba018b0f63 100644
--- a/compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java
@@ -16,7 +16,10 @@ public class SystemLibraryManagerTest extends TestCase {
assertNotNull(fullUri);
assertEquals("dart", fullUri.getScheme());
assertEquals("core", fullUri.getHost());
- assertTrue(getPath(fullUri).endsWith("/corelib.dart"));
+ String path = getPath(fullUri);
+ assertTrue(path.endsWith(".dart"));
+ assertTrue(path.contains(SystemLibraryManager.DEFAULT_SDK_PATH));
+ assertTrue(path.contains("core"));
}
public void testExpand2() throws Exception {
@@ -24,8 +27,11 @@ public class SystemLibraryManagerTest extends TestCase {
URI fullUri = systemLibraryManager.expandRelativeDartUri(shortUri);
assertNotNull(fullUri);
assertEquals("dart", fullUri.getScheme());
- assertEquals("core", fullUri.getHost());
- assertTrue(getPath(fullUri).endsWith("/corelib_impl.dart"));
+ assertEquals("coreimpl", fullUri.getHost());
+ String path = getPath(fullUri);
+ assertTrue(path.endsWith(".dart"));
+ assertTrue(path.contains(SystemLibraryManager.DEFAULT_SDK_PATH));
+ assertTrue(path.contains("coreimpl"));
}
public void testExpand3() throws Exception {
@@ -34,8 +40,11 @@ public class SystemLibraryManagerTest extends TestCase {
URI fullUri2 = systemLibraryManager.expandRelativeDartUri(fullUri1);
assertNotNull(fullUri2);
assertEquals("dart", fullUri2.getScheme());
- assertEquals("core", fullUri2.getHost());
- assertTrue(getPath(fullUri2).endsWith("/corelib_impl.dart"));
+ assertEquals("coreimpl", fullUri2.getHost());
+ String path = getPath(fullUri2);
+ assertTrue(path.endsWith(".dart"));
+ assertTrue(path.contains(SystemLibraryManager.DEFAULT_SDK_PATH));
+ assertTrue(path.contains("coreimpl"));
}
public void testExpand4() throws Exception {
@@ -50,8 +59,11 @@ public class SystemLibraryManagerTest extends TestCase {
URI translatedURI = systemLibraryManager.translateDartUri(fullUri);
assertNotNull(translatedURI);
String scheme = translatedURI.getScheme();
- assertTrue(scheme.equals("file") || scheme.equals("jar"));
- assertTrue(getPath(translatedURI).endsWith("/corelib.dart"));
+ assertTrue(scheme.equals("file"));
+ String path = getPath(translatedURI);
+ assertTrue(path.endsWith(".dart"));
+ assertTrue(path.contains(SystemLibraryManager.DEFAULT_SDK_PATH));
+ assertTrue(path.contains("core"));
}
public void testTranslate2() throws Exception {
@@ -60,8 +72,11 @@ public class SystemLibraryManagerTest extends TestCase {
URI translatedURI = systemLibraryManager.translateDartUri(fullUri);
assertNotNull(translatedURI);
String scheme = translatedURI.getScheme();
- assertTrue(scheme.equals("file") || scheme.equals("jar"));
- assertTrue(getPath(translatedURI).endsWith("/corelib_impl.dart"));
+ assertTrue(scheme.equals("file"));
+ String path = getPath(translatedURI);
+ assertTrue(path.endsWith(".dart"));
+ assertTrue(path.contains(SystemLibraryManager.DEFAULT_SDK_PATH));
+ assertTrue(path.contains("coreimpl"));
}
public void testTranslate3() throws Exception {
@@ -79,7 +94,7 @@ public class SystemLibraryManagerTest extends TestCase {
/**
* For FS based {@link URI} the path is not <code>null</code>, for JAR {@link URI} the scheme
* specific part is not <code>null</code>.
- *
+ *
* @return the scheme specific path.
*/
private static String getPath(URI uri) {
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | compiler/lib/clock.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698