std/text/levenshtein_distance_test.ts
2024-04-29 11:57:30 +09:00

18 lines
446 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "@std/assert";
import { levenshteinDistance } from "./mod.ts";
Deno.test("levenshteinDistance() handles basic cases", function () {
assertEquals(
levenshteinDistance("aa", "bb"),
2,
);
});
Deno.test("levenshteinDistance() handles same strings", function () {
assertEquals(
levenshteinDistance("aa", "aa"),
0,
);
});