You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
675 B
TypeScript
27 lines
675 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { backspaceCompare } from "./backspaceCompare.ts";
|
|
|
|
describe("backspaceCompare", () => {
|
|
|
|
it("ab#c, ad#c => true", () => {
|
|
expect(backspaceCompare("ab#c", "ad#c")).toBeTruthy();
|
|
});
|
|
|
|
it("ab##, c#d# => true", () => {
|
|
expect(backspaceCompare("ab##", "c#d#")).toBeTruthy();
|
|
});
|
|
|
|
it("a#c, b => false", () => {
|
|
expect(backspaceCompare("a#c", "b")).toBeFalsy();
|
|
});
|
|
|
|
it("bxj##tw, bxj###tw => false", () => {
|
|
expect(backspaceCompare("bxj##tw", "bxj###tw")).toBeFalsy();
|
|
});
|
|
|
|
it("nzp#o#g, b#nzp#o#g => true", () => {
|
|
expect(backspaceCompare("nzp#o#g", "b#nzp#o#g")).toBeTruthy();
|
|
});
|
|
});
|
|
|