UNPKG

ts-ds-tool

Version:

Data structure and algorithm of TypeScript

33 lines (24 loc) 519 B
import { lcs } from "../lcs"; describe("lcs test", () => { it("should find position in string" , () => { expect(lcs("", "")).toEqual(""); expect(lcs("", "ABC")).toEqual(""); expect(lcs("ABC" , "")).toEqual(""); expect(lcs( "ABC", "DEFG" )).toEqual(""); expect(lcs( "ABCDGH", "AEDFHR" )).toEqual("ADH"); expect(lcs( "AGGTAB", "GXTXAYB" )).toEqual("GTAB"); expect(lcs( "ABCDAF", "ACBCF" )).toEqual("ABCF"); }); });