import { cleanInput } from "./repl.ts";
import { describe, expect, test } from "vitest";

describe.each([
  {
    input: " hello world ",
    expected: ["hello", "world"],
  },
  {
    input: " This is a Test ",
    expected: ["this", "is", "a", "test"],
  }
])("cleanInput($input)", ({ input, expected }) => {
  test(`Expected: ${expected}`, () => {
    const actual = cleanInput(input);
    expect(actual).toHaveLength(expected.length);
    for (const i in expected) {
      expect(actual[i]).toBe(expected[i]);
    }
  });
});
