OSDN Git Service

change kgram format
[stigmata/stigmata-plugins.git] / kgram / src / test / java / jp / sourceforge / stigmata / birthmarks / kgram / KGramTest.java
index b34ecb2..22b2564 100644 (file)
@@ -5,7 +5,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 /**
- * 
+ *
  * @author Haruaki Tamada
  */
 public class KGramTest{
@@ -19,6 +19,15 @@ public class KGramTest{
     }
 
     @Test
+    public void testStringRepresentation(){
+        KGram<String>[] kgrams = KGramBuilder.getInstance().buildKGram(plainValues, 4);
+        Assert.assertEquals("a b c d", kgrams[0].toString());
+        Assert.assertEquals("b c d e", kgrams[1].toString());
+        Assert.assertEquals("c d e f", kgrams[2].toString());
+        Assert.assertEquals("d e f g", kgrams[3].toString());
+    }
+
+    @Test
     public void checkPlainKGram(){
         KGram<String>[] kgrams = KGramBuilder.getInstance().buildKGram(plainValues, 4);
         Assert.assertEquals(4, kgrams.length);