deno.land / x / masx200_leetcode_test@10.6.5 / replace-words / test.ts
123456789101112131415import { assertEquals } from "../deps.ts";import replaceWords from "./index.ts";
Deno.test("replace-words", () => { const dictionary = ["cat", "bat", "rat"]; const sentence = "the cattle was rattled by the battery"; const result = replaceWords(dictionary, sentence); assertEquals(result, "the cat was rat by the bat");
assertEquals( "a a b c", replaceWords(["a", "b", "c"], "aadsfasf absbs bbab cadsfafs"), );});
Version Info