Commit 5c1357d0 authored by Arnaud LANOIX's avatar Arnaud LANOIX
Browse files

Add test ope distance levenshtein

parent fa6e0824
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestOperationsDistanceLevenshtein {
iDistance dist;
@BeforeEach
public void setUp() {
dist = new DistanceLevenshtein(1,1,1);
}
@Test
public void test_cadeau_cadeau_operations() {
String expected = "[id(0), id(1), id(2), id(3), id(4), id(5)]";
String res = dist.listeOperations("cadeau", "cadeau").toString();
System.out.println(res);
assertEquals(expected, res);
}
@Test
public void test_cadeau_bateaux_operations() {
String expected = "[subst(c,0,b), id(1), subst(d,2,t), id(3), id(4), id(5), ins(x,6)]";
String res = dist.listeOperations("cadeau", "bateaux").toString();
System.out.println(res);
assertEquals(expected, res);
}
@Test
public void test_algoritme_algorithme_operations() {
String expected = "[id(0), id(1), id(2), id(3), id(4), id(5), id(6), ins(h,7), id(8), id(9)]";
String res = dist.listeOperations("algoritme", "algorithme").toString();
System.out.println(res);
assertEquals(expected, res);
}
@Test
public void test_algoritme_programme_operations() {
String expected = "[subst(a,0,p), subst(l,1,r), subst(g,2,o), subst(o,3,g), id(4), subst(i,5,a), subst(t,6,m), id(7), id(8)]";
String res = dist.listeOperations("algoritme", "programme").toString();
System.out.println(res);
assertEquals(expected, res);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment