User reported testcase for bug 349.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@935 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/test/com/google/inject/CircularDependencyTest.java b/test/com/google/inject/CircularDependencyTest.java
index 2832441..47b00f2 100644
--- a/test/com/google/inject/CircularDependencyTest.java
+++ b/test/com/google/inject/CircularDependencyTest.java
@@ -83,4 +83,32 @@
   static class D {
     @Inject D(C c) {}
   }
+
+  /**
+   * As reported by issue 349, we give a lousy trace when a class is circularly
+   * dependent on itself in multiple ways.
+   */
+  public void testCircularlyDependentMultipleWays() {
+    Injector injector = Guice.createInjector(new AbstractModule() {
+      protected void configure() {
+        binder.bind(A.class).to(E.class);
+        binder.bind(B.class).to(E.class);
+      }
+    });
+    injector.getInstance(A.class);
+  }
+
+  @Singleton
+  static class E implements A, B {
+    @Inject
+    public E(A a, B b) {}
+
+    public B getB() {
+      return this;
+    }
+
+    public A getA() {
+      return this;
+    }
+  }
 }