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();
  });
});

