You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jk...@apache.org on 2011/09/23 05:27:25 UTC

svn commit: r1174507 - /incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/util/SpanTest.java

Author: jkosin
Date: Fri Sep 23 03:27:24 2011
New Revision: 1174507

URL: http://svn.apache.org/viewvc?rev=1174507&view=rev
Log:
OPENNLP-298: fixed the SpanTest class to properly check the span indexes.

Modified:
    incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/util/SpanTest.java

Modified: incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/util/SpanTest.java
URL: http://svn.apache.org/viewvc/incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/util/SpanTest.java?rev=1174507&r1=1174506&r2=1174507&view=diff
==============================================================================
--- incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/util/SpanTest.java (original)
+++ incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/util/SpanTest.java Fri Sep 23 03:27:24 2011
@@ -102,11 +102,16 @@ public class SpanTest {
   public void testContainsInt() {
     Span a = new Span(10, 300);
 
+    /* NOTE: here the span does not contain the endpoint marked as the end
+     * for the span.  This is because the end should be placed one past the
+     * true end for the span.  The indexes used must observe the same
+     * requirements for the contains function.
+     */
     assertFalse(a.contains(9));
     assertTrue(a.contains(10));
     assertTrue(a.contains(200));
-    assertTrue(a.contains(300));
-    assertFalse(a.contains(301));
+    assertTrue(a.contains(299));
+    assertFalse(a.contains(300));
   }
 
   /**