std/text/levenshtein_distance_test.ts

18 lines
440 B
TypeScript
Raw Normal View History

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