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

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

Issue 9034022: Include compiler tests suite, tweaks for tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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/javatests/com/google/dart/compiler/PrettyErrorFormatterTest.java ('k') | no next file » | 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 393ef28afb261be2f1e026d431033e162a61c06c..10f4d6c8061e50c075476a18e885221ce79512bd 100644
--- a/compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java
@@ -16,7 +16,7 @@ public class SystemLibraryManagerTest extends TestCase {
assertNotNull(fullUri);
assertEquals("dart", fullUri.getScheme());
assertEquals("core", fullUri.getHost());
- assertTrue(fullUri.getPath().endsWith("/corelib.dart"));
+ assertTrue(getPath(fullUri).endsWith("/corelib.dart"));
}
public void testExpand2() throws Exception {
@@ -25,7 +25,7 @@ public class SystemLibraryManagerTest extends TestCase {
assertNotNull(fullUri);
assertEquals("dart", fullUri.getScheme());
assertEquals("core", fullUri.getHost());
- assertTrue(fullUri.getPath().endsWith("/corelib_impl.dart"));
+ assertTrue(getPath(fullUri).endsWith("/corelib_impl.dart"));
}
public void testExpand3() throws Exception {
@@ -35,7 +35,7 @@ public class SystemLibraryManagerTest extends TestCase {
assertNotNull(fullUri2);
assertEquals("dart", fullUri2.getScheme());
assertEquals("core", fullUri2.getHost());
- assertTrue(fullUri2.getPath().endsWith("/corelib_impl.dart"));
+ assertTrue(getPath(fullUri2).endsWith("/corelib_impl.dart"));
}
public void testExpand4() throws Exception {
@@ -51,7 +51,7 @@ public class SystemLibraryManagerTest extends TestCase {
assertNotNull(translatedURI);
String scheme = translatedURI.getScheme();
assertTrue(scheme.equals("file") || scheme.equals("jar"));
- assertTrue(translatedURI.getPath().endsWith("/corelib.dart"));
+ assertTrue(getPath(translatedURI).endsWith("/corelib.dart"));
}
public void testTranslate2() throws Exception {
@@ -61,7 +61,7 @@ public class SystemLibraryManagerTest extends TestCase {
assertNotNull(translatedURI);
String scheme = translatedURI.getScheme();
assertTrue(scheme.equals("file") || scheme.equals("jar"));
- assertTrue(translatedURI.getPath().endsWith("/corelib_impl.dart"));
+ assertTrue(getPath(translatedURI).endsWith("/corelib_impl.dart"));
}
public void testTranslate3() throws Exception {
@@ -75,4 +75,17 @@ public class SystemLibraryManagerTest extends TestCase {
assertTrue(message.contains(fullUri.toString()));
}
}
+
+ /**
+ * 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) {
+ if (uri.getPath() != null) {
+ return uri.getPath();
+ }
+ return uri.getSchemeSpecificPart();
+ }
}
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/PrettyErrorFormatterTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698