/** * Copyright (c) 2026, Salesforce, Inc., * All rights reserved. * For full license text, see the LICENSE.txt file */ import { describe, expect, it } from "vitest"; import { tokenizeCommand } from "../tokenize.js"; describe("lib/tokenize", () => { it("splits on unquoted spaces", () => { expect(tokenizeCommand("select Id Name")).toEqual(["select", "Id", "Name"]); }); it("keeps single-quoted segments intact", () => { expect(tokenizeCommand('set where=\'{"Status":{"eq":"New"}}\'')).toEqual([ "set", 'where=\'{"Status":{"eq":"New"}}\'', ]); }); it("keeps double-quoted segments intact", () => { expect(tokenizeCommand('set @args/where/Name/like "Acme%"')).toEqual([ "set", "@args/where/Name/like", "Acme%", ]); }); it("returns empty array for blank input", () => { expect(tokenizeCommand(" ")).toEqual([]); }); });