This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: GapContent PositionTest


I added some more complex test cases for GapContent. 

2006-01-05  Lillian Angel  <langel@redhat.com>

        * gnu/testlet/javax/swing/text/GapContent/PositionTest.java
        (testComplex): Added more test cases.

Index: gnu/testlet/javax/swing/text/GapContent/PositionTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/text/GapContent/PositionTest.java,v
retrieving revision 1.3
diff -u -r1.3 PositionTest.java
--- gnu/testlet/javax/swing/text/GapContent/PositionTest.java	18 Oct 2005 14:24:01 -0000	1.3
+++ gnu/testlet/javax/swing/text/GapContent/PositionTest.java	5 Jan 2006 20:02:54 -0000
@@ -103,6 +103,20 @@
         c.insertString(5, "12345");
         harness.check(p1.getOffset(), 0);
         harness.check(p2.getOffset(), 21);
+        
+        PlainDocument doc = new PlainDocument();
+        doc.insertString(0, "cdefgh", null);
+        Position s = doc.createPosition(1);
+        harness.check(s.getOffset(), 1);
+
+        doc.insertString(0, "a", null);
+        harness.check(s.getOffset(), 2);
+        Position a = doc.createPosition(1);
+        harness.check(a.getOffset(), 1);
+
+        doc.insertString(1, "b", null);
+        harness.check(s.getOffset(), 3);
+        harness.check(a.getOffset(), 2);
       }
     catch (BadLocationException ex)
       {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]