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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/SystemLibraryManagerProviderTest.java

Issue 9909012: Prevent duplicate entries in the bundled libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/SystemLibraryManager.java ('k') | lib/config/import_any.config » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/SystemLibraryManagerProviderTest.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/SystemLibraryManagerProviderTest.java (revision 5968)
+++ editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/SystemLibraryManagerProviderTest.java (working copy)
@@ -18,6 +18,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collection;
+import java.util.HashSet;
public abstract class SystemLibraryManagerProviderTest extends TestCase {
@@ -59,6 +60,21 @@
assertTrue(specs.contains("dart:uri"));
}
+ public void test_SystemLibraryManagerProvider_getAllLibrarySpecs_no_duplicates() throws Exception {
+ EditorLibraryManager libraryManager = getLibraryManager();
+ Collection<String> specs = libraryManager.getAllLibrarySpecs();
+ Collection<String> visited = new HashSet<String>();
+ String actual = "";
+ for (String eachSpec : specs) {
+ if (visited.contains(eachSpec)) {
+ actual += eachSpec + ", ";
+ } else {
+ visited.add(eachSpec);
+ }
+ }
+ assertEquals("", actual);
+ }
+
public void test_SystemLibraryManagerProvider_translateDoesNotExist() throws Exception {
URI fullUri = new URI("dart://doesnotexist/some/file.dart");
try {
« no previous file with comments | « compiler/java/com/google/dart/compiler/SystemLibraryManager.java ('k') | lib/config/import_any.config » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698