You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
419 B
21 lines
419 B
2 years ago
|
package editdistance
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestWerner(t *testing.T) {
|
||
|
|
||
|
a := "a b c"
|
||
|
b := "a b d"
|
||
|
diff := Werner(a, b)
|
||
|
if diff != 1 {
|
||
|
t.Errorf("Werner was incorrect, got %d, want %d.", diff, 1)
|
||
|
}
|
||
|
|
||
|
a = "Mary had a little lamb little lamb little lamb."
|
||
|
b = "Marry had a little lamb little lab little lamb."
|
||
|
diff = Werner(a, b)
|
||
|
if diff != 2 {
|
||
|
t.Errorf("Werner was incorrect, got %d, want %d.", diff, 2)
|
||
|
}
|
||
|
}
|