package org.antlr.codebuff;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class TestLevenshtein {
	@Test
	public void simple() {
		float d = Tool.levenshteinDistance("abc", "abd");
		assertEquals(1, d);

		d = Tool.levenshteinDistance("kitten", "sitten");
		assertEquals(1, d);

		d = Tool.levenshteinDistance("sittin", "sitting");
		assertEquals(1, d);
	}
}

@@ -214,35 +214,50 @@
 %09%09assertEquals(1
-, d
+.0/3.0, d, 0.00001
 );%0A%0A%09%09d = Tool.l
@@ -312,19 +312,48 @@
 Equals(1
-, d
+.0/%22kitten%22.length(), d, 0.00001
 );%0A%0A%09%09d 
@@ -417,19 +417,49 @@
 Equals(1
-, d
+.0/%22sitting%22.length(), d, 0.00001
 );%0A%09%7D%0A%7D%0A

fix unit test